Skip to content

Commit f2ef8b2

Browse files
author
Luca Degasperi
committed
Update README.md
1 parent 13f8ed4 commit f2ef8b2

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,18 @@ This grant type is the easiest to use and is ideal for highly trusted clients. T
150150
'access_token_ttl' => 604800,
151151
'callback' => function($username, $password){
152152

153-
return Auth::validate(array(
154-
'email' => $username,
153+
$credentials = array(
154+
'email' => $username,
155155
'password' => $password,
156-
));
156+
);
157+
158+
$valid = Auth::validate($credentials);
159+
160+
if (!$valid) {
161+
return false;
162+
}
163+
164+
return Auth::getProvider()->retrieveByCredentials($credentials)->id;
157165
}
158166
),
159167
```

0 commit comments

Comments
 (0)