File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -113,10 +113,13 @@ protected function hasValidProvider($tokenable)
113
113
*/
114
114
protected function isValidAccessToken ($ accessToken ): bool
115
115
{
116
- $ is_valid = $ accessToken && (
117
- ($ this ->expiration && $ accessToken ->created_at ->gt (now ()->subMinutes ($ this ->expiration )))
118
- || $ this ->hasValidProvider ($ accessToken ->tokenable )
119
- );
116
+ if (!$ accessToken ) {
117
+ return false ;
118
+ }
119
+
120
+ $ is_valid =
121
+ (!$ this ->expiration || $ accessToken ->created_at ->gt (now ()->subMinutes ($ this ->expiration )))
122
+ && $ this ->hasValidProvider ($ accessToken ->tokenable );
120
123
121
124
if (is_callable (Sanctum::$ validateCallback )) {
122
125
$ is_valid = (bool ) (Sanctum::$ validateCallback )($ accessToken , $ is_valid );
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class Sanctum
28
28
*
29
29
* @var callable|null
30
30
*/
31
- public static $ validateCallback = null ;
31
+ public static $ validateCallback ;
32
32
33
33
/**
34
34
* Set the current user for the application with the given abilities.
You can’t perform that action at this time.
0 commit comments