Skip to content

Commit 32e5a6a

Browse files
authored
Moved provider check to bearer token only (#1246)
1 parent 586fc5a commit 32e5a6a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Guards/TokenGuard.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,6 @@ protected function hasValidProvider(Request $request)
108108
*/
109109
public function user(Request $request)
110110
{
111-
if (! $this->hasValidProvider($request)) {
112-
return;
113-
}
114-
115111
if ($request->bearerToken()) {
116112
return $this->authenticateViaBearerToken($request);
117113
} elseif ($request->cookie(Passport::cookie())) {
@@ -154,6 +150,10 @@ protected function authenticateViaBearerToken($request)
154150
return;
155151
}
156152

153+
if (! $this->hasValidProvider($request)) {
154+
return;
155+
}
156+
157157
// If the access token is valid we will retrieve the user according to the user ID
158158
// associated with the token. We will use the provider implementation which may
159159
// be used to retrieve users from Eloquent. Next, we'll be ready to continue.

0 commit comments

Comments
 (0)