1 | <?php |
||
18 | class MultiAuthenticate extends Authenticate |
||
19 | { |
||
20 | /** |
||
21 | * @var \League\OAuth2\Server\ResourceServer |
||
22 | */ |
||
23 | protected $server; |
||
24 | |||
25 | /** |
||
26 | * @var \SMartins\PassportMultiauth\ProviderRepository |
||
27 | */ |
||
28 | protected $providers; |
||
29 | |||
30 | /** |
||
31 | * Create a new middleware instance. |
||
32 | * |
||
33 | * @param ResourceServer $server |
||
34 | * @param ProviderRepository $providers |
||
35 | * @param Auth $auth |
||
36 | */ |
||
37 | 13 | public function __construct( |
|
47 | |||
48 | /** |
||
49 | * Handle an incoming request. Authenticates the guard from access token |
||
50 | * used on request. |
||
51 | * |
||
52 | * @param \Illuminate\Http\Request $request |
||
53 | * @param \Closure $next |
||
54 | * @param string[] ...$guards |
||
55 | * @return mixed |
||
56 | * |
||
57 | * @throws \Illuminate\Auth\AuthenticationException |
||
58 | */ |
||
59 | 13 | public function handle($request, Closure $next, ...$guards) |
|
98 | |||
99 | /** |
||
100 | * Check if user acting has the required guards and scopes on request. |
||
101 | * |
||
102 | * @param Authenticatable $user |
||
103 | * @param array $guards |
||
104 | * @return bool |
||
105 | */ |
||
106 | 6 | public function canBeAuthenticated(Authenticatable $user, $guards) |
|
112 | |||
113 | /** |
||
114 | * Authenticate correct guard based on token. |
||
115 | * |
||
116 | * @param \SMartins\PassportMultiauth\Provider $token |
||
117 | * @param array $guards |
||
118 | * @return void |
||
119 | * |
||
120 | * @throws \Illuminate\Auth\AuthenticationException |
||
121 | */ |
||
122 | 2 | public function authenticateTokenGuard(Token $token, $guards) |
|
131 | } |
||
132 |