Skip to content

Commit

Permalink
Merge pull request #97 from dunglas/raw-token-alt
Browse files Browse the repository at this point in the history
Give access to the raw JWT in the user provider (alternative implem)
  • Loading branch information
Widcket authored Jun 22, 2020
2 parents 79649f9 + d2a2bcf commit 9eb26bc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Security/Guard/JwtGuardAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ public function getUser($credentials, UserProviderInterface $userProvider)
return new User('unknown', null, []);
}

if (!isset($jwt->token)) {
$jwt->token = $credentials['jwt'];
}

if ($userProvider instanceof JWTUserProviderInterface) {
return $userProvider->loadUserByJWT($jwt);
}
Expand Down

0 comments on commit 9eb26bc

Please sign in to comment.