mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-59275 auth: prevent user login failed coding error
This commit is contained in:
parent
6bb80a1917
commit
92c8cb9d98
@ -346,7 +346,7 @@ class auth extends \auth_plugin_base {
|
||||
* Complete the login process after oauth handshake is complete.
|
||||
* @param \core\oauth2\client $client
|
||||
* @param string $redirecturl
|
||||
* @return none Either redirects or throws an exception
|
||||
* @return void Either redirects or throws an exception
|
||||
*/
|
||||
public function complete_login(client $client, $redirecturl) {
|
||||
global $CFG, $SESSION, $PAGE;
|
||||
@ -356,7 +356,7 @@ class auth extends \auth_plugin_base {
|
||||
if (!$userinfo) {
|
||||
// Trigger login failed event.
|
||||
$failurereason = AUTH_LOGIN_NOUSER;
|
||||
$event = \core\event\user_login_failed::create(['other' => ['username' => $userinfo['username'],
|
||||
$event = \core\event\user_login_failed::create(['other' => ['username' => 'unknown',
|
||||
'reason' => $failurereason]]);
|
||||
$event->trigger();
|
||||
|
||||
@ -368,7 +368,7 @@ class auth extends \auth_plugin_base {
|
||||
if (empty($userinfo['username']) || empty($userinfo['email'])) {
|
||||
// Trigger login failed event.
|
||||
$failurereason = AUTH_LOGIN_NOUSER;
|
||||
$event = \core\event\user_login_failed::create(['other' => ['username' => $userinfo['username'],
|
||||
$event = \core\event\user_login_failed::create(['other' => ['username' => 'unknown',
|
||||
'reason' => $failurereason]]);
|
||||
$event->trigger();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user