Skip to content

SudoSOS Back-end API / authentication / JsonWebToken

Class: JsonWebToken ​

The contents of the JWT used for user authentication.

Constructors ​

Constructor ​

ts
new JsonWebToken(): JsonWebToken;

Returns ​

JsonWebToken

Properties ​

PropertyModifierTypeDescription
acceptedToS?publicTermsOfServiceStatusThe TOS status of the user, computed against the current TOS version at the time the token was signed.
exp?readonlynumberThe JWT expiry field. Set automatically by signing the token.
iat?readonlynumberThe JWT expiry field. Set automatically by signing the token.
nbf?readonlynumberThe JWT not-before field. Set automatically by signing the token.
organs?publicUser[]All the organs that the user is a part of.
overrideMaintenance?publicbooleanWhether this token should still be able to access all endpoints in maintenance mode
posId?publicnumberThe POS identifier. If present, this token is a "lesser" token (restricted access token created via PIN/NFC authentication). The presence of posId indicates a lesser token.
rolespublicstring[]The roles that are assigned to the specific user.
userpublicUserThe token holds a reference to the user to which this token belongs.