File tree 1 file changed +12
-5
lines changed
1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -13,19 +13,26 @@ class UserResolver implements Resolver
13
13
*/
14
14
public static function resolve ()
15
15
{
16
+ $ guardsConfig = Config::get ('auth.guards ' );
16
17
$ guards = Config::get ('audit.user.guards ' , [
17
18
Config::get ('auth.defaults.guard ' ),
18
19
]);
19
20
20
21
foreach ($ guards as $ guard ) {
21
- try {
22
- $ authenticated = Auth::guard ($ guard )->check ();
23
- } catch (\Exception $ exception ) {
22
+ if (($ guardsConfig [$ guard ]['driver ' ] ?? null ) === 'sanctum ' ) {
23
+ if ($ user = Auth::user ()) {
24
+ return $ user ;
25
+ }
26
+
24
27
continue ;
25
28
}
26
29
27
- if ($ authenticated === true ) {
28
- return Auth::guard ($ guard )->user ();
30
+ try {
31
+ if ($ user = Auth::guard ($ guard )->user ()) {
32
+ return $ user ;
33
+ }
34
+ } catch (\Exception $ exception ) {
35
+ continue ;
29
36
}
30
37
}
31
38
You can’t perform that action at this time.
0 commit comments