Archived
1
0
Fork 0

app/library/Auth.php: fire events when users log in.

This commit is contained in:
Henrik Hautakoski 2018-04-01 18:28:19 +02:00
parent 8666e3b707
commit aab77e9608

View file

@ -28,7 +28,11 @@ class Auth extends Component
// Verify password
$hash = $user->getPassword();
if (strlen($hash) > 1 && password_verify($password, $hash)) {
$this->setIdentity($user->getId());
$this->_eventsManager->fire('auth:onLogin', $this, 'password');
return true;
}
}
@ -68,6 +72,9 @@ class Auth extends Component
}
$this->setIdentity($user->getId());
$this->_eventsManager->fire('auth:onLogin', $this,
"OAuth {$auth['provider']}");
}
/**