diff options
Diffstat (limited to 'lib/private/Authentication')
-rw-r--r-- | lib/private/Authentication/LoginCredentials/Store.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/Authentication/LoginCredentials/Store.php b/lib/private/Authentication/LoginCredentials/Store.php index 6dd7dc3fb73..0a3b57b9c6c 100644 --- a/lib/private/Authentication/LoginCredentials/Store.php +++ b/lib/private/Authentication/LoginCredentials/Store.php @@ -111,8 +111,13 @@ class Store implements IStore { } if ($trySession && $this->session->exists('login_credentials')) { - $creds = json_decode($this->session->get('login_credentials')); - return new Credentials($creds->uid, $creds->loginName, $creds->password); + /** @var array $creds */ + $creds = json_decode($this->session->get('login_credentials'), true); + return new Credentials( + $creds['uid'], + $creds['loginName'] ?? $this->session->get('loginname') ?? $creds['uid'], // Pre 20 didn't have a loginName property, hence fall back to the session value and then to the UID + $creds['password'] + ); } // If we reach this line, an exception was thrown. |