diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2020-09-08 10:26:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-08 10:26:23 +0200 |
commit | ac5f2914c7652c0bd71f2f0bb43385d866547985 (patch) | |
tree | d65c9aa50760909976f4118d0c4d034fb40861c3 /lib/private/Authentication | |
parent | 292c86fc293682607f83a3b0cd29a7b6286c4426 (diff) | |
parent | adf100a42ffdbcc25eda717c8a80e0ba0458f437 (diff) | |
download | nextcloud-server-ac5f2914c7652c0bd71f2f0bb43385d866547985.tar.gz nextcloud-server-ac5f2914c7652c0bd71f2f0bb43385d866547985.zip |
Merge pull request #22641 from nextcloud/fix/credentials-store-upgrade-property-undefined
Fix undefined class property access after upgrade from 19 to 20
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 5b562dd276e..29bc4f6a2e1 100644 --- a/lib/private/Authentication/LoginCredentials/Store.php +++ b/lib/private/Authentication/LoginCredentials/Store.php @@ -112,8 +112,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. |