Reading the JWT Payload (Securely)
getJWTPayloadSecurely
function: API Reference
The import SuperTokensRequest from 'supertokens-website/axios';
let payload = await SuperTokensRequest.getJWTPayloadSecurely();
await supertokens.axios.getJWTPayloadSecurely();
- Returns a
Promise<JSON object>
or throws an error in case reading failed. - This does not read from the access token, since that is in
httpOnly
cookie. Instead, it reads from another token that contains a copy of the payload in the access token.