Provider instance
Decoded JWT payload
Expiration of token
Time token was issued
Issuer of token (MyScribae)
Private
providerProvider instance
Claims associated with this token
User identififier for your application
To make it easier to check a user's level of access.
Matches specific script groups and/or scripts.
Optional
script
const token = new SubscriptionToken(provider, payload);
const isAllowed = token.matches({
script_id:'my-script-id',
script_group_id:'my-script-group-id'
});
if (!isAllowed) {
// User does not have access to this script
// return 403
}
// User has access to this script
Generated using TypeDoc
After a token is validated, it's payload is passed to this class, where it is parsed and stored for easy access.