Closed jesuismaxime closed 3 months ago
Any follow up?
You should be able to do something like the following:
$tokenService = GraphqlAuthentication::$tokenService;
$jwt = $tokenService->parseToken('the_token');
$user = $tokenService->getUserFromToken($jwt);
Once the user is logged through the GQL mutation, I need to validate that a User exist into a custom PHP Module. Even tho the mutation is successful (JSON response), the Craft's native
Craft::$app->getUser()->getIdentity()
returnnull
.Notes:
getUserFromToken
in the backend, but the function do not accept a string, so this was a dead end.