Skip to content
Snippets Groups Projects
Commit 09c7f0a6 authored by Jared Hancock's avatar Jared Hancock
Browse files

Keep session after change of email address

parent 042caef5
No related branches found
No related tags found
No related merge requests found
......@@ -523,7 +523,7 @@ abstract class UserAuthenticationBackend extends AuthenticationBackend {
}
protected function getAuthKey($user) {
return $user->getUsername();
return $user->getId();
}
static function getUser() {
......@@ -546,12 +546,13 @@ abstract class UserAuthenticationBackend extends AuthenticationBackend {
return $user;
}
protected function validate($username) {
if (!($acct = ClientAccount::lookupByUsername($username)))
return;
protected function validate($userid) {
if (!($user = User::lookup($userid)))
return false;
elseif (!$user->getAccount())
return false;
if (($client = new ClientSession(new EndUser($acct->getUser()))) && $client->getId())
return $client;
return new ClientSession(new EndUser($user));
}
}
......
......@@ -120,7 +120,7 @@ class ClientSession extends EndUser {
parent::__construct($user);
$this->token = &$_SESSION[':token']['client'];
// XXX: Change the key to user-id
$this->session= new UserSession($user->getUserName());
$this->session= new UserSession($user->getId());
}
function isValid(){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment