summaryrefslogtreecommitdiffstats
path: root/lib/private/Authentication
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-09-08 10:26:23 +0200
committerGitHub <noreply@github.com>2020-09-08 10:26:23 +0200
commitac5f2914c7652c0bd71f2f0bb43385d866547985 (patch)
treed65c9aa50760909976f4118d0c4d034fb40861c3 /lib/private/Authentication
parent292c86fc293682607f83a3b0cd29a7b6286c4426 (diff)
parentadf100a42ffdbcc25eda717c8a80e0ba0458f437 (diff)
downloadnextcloud-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.php9
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.