1 | <?php |
||
20 | class MultiAuthenticate extends Authenticate |
||
21 | { |
||
22 | /** |
||
23 | * @var \League\OAuth2\Server\ResourceServer |
||
24 | */ |
||
25 | protected $server; |
||
26 | |||
27 | /** |
||
28 | * @var \SMartins\PassportMultiauth\ProviderRepository |
||
29 | */ |
||
30 | protected $providers; |
||
31 | |||
32 | /** |
||
33 | * The authentication factory instance. |
||
34 | * |
||
35 | * @var \Illuminate\Contracts\Auth\Factory |
||
36 | */ |
||
37 | protected $auth; |
||
38 | |||
39 | 12 | public function __construct(ResourceServer $server, ProviderRepository $providers, Auth $auth) |
|
45 | |||
46 | /** |
||
47 | * Handle an incoming request. Authenticates the guard from access token |
||
48 | * used on request. |
||
49 | * |
||
50 | * @param \Illuminate\Http\Request $request |
||
51 | * @param \Closure $next |
||
52 | * @param string[] ...$guards |
||
53 | * |
||
54 | * @return mixed |
||
55 | */ |
||
56 | 12 | 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 \Illuminate\Foundation\Auth\User $user |
||
103 | * @param \Illuminate\Http\Request $request |
||
104 | * @return bool |
||
105 | */ |
||
106 | 6 | public function canBeAuthenticated(Authenticatable $user, Request $request) |
|
114 | |||
115 | /** |
||
116 | * Authenticate correct guard based on token. |
||
117 | * |
||
118 | * @param \SMartins\PassportMultiauth\Provider $token |
||
119 | * @param array $guards |
||
120 | * @return void |
||
121 | */ |
||
122 | 2 | public function authenticateTokenGuard(Token $token, $guards) |
|
135 | } |
||
136 |