Skip to content

Commit 031a24d

Browse files
committed
Updated the configuration that had a bug when trying to return the authenticated user.
1 parent a97064a commit 031a24d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/config/oauth2.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,18 @@
7171
'access_token_ttl' => 604800,
7272
'callback' => function ($username, $password) {
7373

74-
return Auth::validate(array(
75-
'email' => $username,
74+
$credentials = array(
75+
'email' => $username,
7676
'password' => $password,
77-
));
77+
);
78+
79+
$valid = Auth::validate($credentials);
80+
81+
if (!$valid) {
82+
return false;
83+
}
84+
85+
return Auth::getProvider()->retrieveByCredentials($credentials)->id;
7886
}
7987
),
8088

0 commit comments

Comments
 (0)