app/library/Auth.php: fire events when users log in.
This commit is contained in:
parent
8666e3b707
commit
aab77e9608
1 changed files with 7 additions and 0 deletions
|
|
@ -28,7 +28,11 @@ class Auth extends Component
|
||||||
// Verify password
|
// Verify password
|
||||||
$hash = $user->getPassword();
|
$hash = $user->getPassword();
|
||||||
if (strlen($hash) > 1 && password_verify($password, $hash)) {
|
if (strlen($hash) > 1 && password_verify($password, $hash)) {
|
||||||
|
|
||||||
$this->setIdentity($user->getId());
|
$this->setIdentity($user->getId());
|
||||||
|
|
||||||
|
$this->_eventsManager->fire('auth:onLogin', $this, 'password');
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -68,6 +72,9 @@ class Auth extends Component
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setIdentity($user->getId());
|
$this->setIdentity($user->getId());
|
||||||
|
|
||||||
|
$this->_eventsManager->fire('auth:onLogin', $this,
|
||||||
|
"OAuth {$auth['provider']}");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Reference in a new issue