1 | <?php |
||
15 | class TokenMiddleware implements LoggerAwareInterface |
||
16 | { |
||
17 | use LoggerAwareTrait; |
||
18 | |||
19 | /** |
||
20 | * @const string |
||
21 | */ |
||
22 | const AUTH_BEARER = 'Bearer %s'; |
||
23 | |||
24 | /** |
||
25 | * @var TokenManager |
||
26 | */ |
||
27 | private $tokenManager; |
||
28 | |||
29 | /** |
||
30 | * TokenMiddleware constructor. |
||
31 | * |
||
32 | * @param TokenManager $tokenManager |
||
33 | */ |
||
34 | 6 | public function __construct(TokenManager $tokenManager) |
|
38 | |||
39 | /** |
||
40 | * Middleware invocation method that actually adds the bearer |
||
41 | * token to the HTTP request. |
||
42 | * |
||
43 | * @param callable $handler |
||
44 | * |
||
45 | * @return \Closure |
||
46 | */ |
||
47 | public function __invoke(callable $handler) |
||
62 | } |
||
63 |