aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJulius Knorr <jus@bitgrid.net>2025-02-28 11:59:10 +0100
committerJulius Knorr <jus@bitgrid.net>2025-03-06 09:31:29 +0100
commit777cd941dc1bf7009bbb8465afd907c75b4d2d7b (patch)
tree3a630dc3093933db9e52c8d6becbc5521c7b1472 /lib
parent373107b6e4ebfd3487c69a122ff3230057a4ae51 (diff)
downloadnextcloud-server-fix/credential-passwordless-auth.tar.gz
nextcloud-server-fix/credential-passwordless-auth.zip
fix: Do not build encrypted password if there is nonefix/credential-passwordless-auth
Signed-off-by: Julius Knorr <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Authentication/LoginCredentials/Store.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/private/Authentication/LoginCredentials/Store.php b/lib/private/Authentication/LoginCredentials/Store.php
index b6f22ce345f..67c5712715c 100644
--- a/lib/private/Authentication/LoginCredentials/Store.php
+++ b/lib/private/Authentication/LoginCredentials/Store.php
@@ -50,7 +50,9 @@ class Store implements IStore {
* @param array $params
*/
public function authenticate(array $params) {
- $params['password'] = $this->crypto->encrypt((string)$params['password']);
+ if ($params['password'] !== null) {
+ $params['password'] = $this->crypto->encrypt((string)$params['password']);
+ }
$this->session->set('login_credentials', json_encode($params));
}
@@ -97,10 +99,12 @@ class Store implements IStore {
if ($trySession && $this->session->exists('login_credentials')) {
/** @var array $creds */
$creds = json_decode($this->session->get('login_credentials'), true);
- try {
- $creds['password'] = $this->crypto->decrypt($creds['password']);
- } catch (Exception $e) {
- //decryption failed, continue with old password as it is
+ if ($creds['password'] !== null) {
+ try {
+ $creds['password'] = $this->crypto->decrypt($creds['password']);
+ } catch (Exception $e) {
+ //decryption failed, continue with old password as it is
+ }
}
return new Credentials(
$creds['uid'],