diff --git a/php/src/Auth/AuthManager.php b/php/src/Auth/AuthManager.php index dc3e2fb6..f18f1a7b 100644 --- a/php/src/Auth/AuthManager.php +++ b/php/src/Auth/AuthManager.php @@ -12,12 +12,8 @@ class AuthManager { $this->configurationManager = $configurationManager; } - public function CheckCredentials(string $username, string $password) : bool { - if($username === $this->configurationManager->GetUserName()) { - return hash_equals($this->configurationManager->GetPassword(), $password); - } - - return false; + public function CheckCredentials(string $password) : bool { + return hash_equals($this->configurationManager->GetPassword(), $password); } public function CheckToken(string $token) : bool { diff --git a/php/src/Controller/LoginController.php b/php/src/Controller/LoginController.php index 1f262d71..c917115c 100644 --- a/php/src/Controller/LoginController.php +++ b/php/src/Controller/LoginController.php @@ -18,9 +18,8 @@ class LoginController } public function TryLogin(Request $request, Response $response, $args) : Response { - $userName = $request->getParsedBody()['username']; $password = $request->getParsedBody()['password']; - if($this->authManager->CheckCredentials($userName, $password)) { + if($this->authManager->CheckCredentials($password)) { $this->authManager->SetAuthState(true); return $response->withHeader('Location', '/')->withStatus(302); } diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index 17bb504a..68b34bb4 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -18,10 +18,6 @@ class ConfigurationManager return []; } - public function GetUserName() : string { - return $this->GetConfig()['username']; - } - public function GetPassword() : string { return $this->GetConfig()['password']; } @@ -32,7 +28,6 @@ class ConfigurationManager public function SetPassword(string $password) : void { $config = $this->GetConfig(); - $config['username'] = 'admin'; $config['password'] = $password; $this->WriteConfig($config); } diff --git a/php/templates/login.twig b/php/templates/login.twig index 16737429..06b875ea 100644 --- a/php/templates/login.twig +++ b/php/templates/login.twig @@ -5,9 +5,8 @@
Log in using your Nextcloud AIO credentials. If you don't have them you can also use the automatic login from your Nextcloud.
+Log in using your Nextcloud AIO password. If you don't have it, you can also use the automatic login from your Nextcloud.