Skip to content

Commit

Permalink
Fix token renewal
Browse files Browse the repository at this point in the history
  • Loading branch information
eljam committed Oct 15, 2017
1 parent 842d6f5 commit b61b2e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ composer.phar
vendor/
bin/*
.php_cs.cache
.idea/
5 changes: 3 additions & 2 deletions src/JwtMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,16 @@ public function __construct(JwtManager $jwtManager)
*/
public function __invoke(callable $handler)
{
$token = $this->jwtManager->getJwtToken()->getToken();
$manager = $this->jwtManager;

return function (
RequestInterface $request,
array $options
) use (
$handler,
$token
$manager
) {
$token = $manager->getJwtToken()->getToken();
return $handler($request->withHeader(
'Authorization',
sprintf(self::AUTH_BEARER, $token)
Expand Down

0 comments on commit b61b2e7

Please sign in to comment.