Methods

hasPermission(currentPermissions, permissionBit) → {boolean}

Checks if a given permission bit is present in the current permissions.
Parameters:
NameTypeDescription
currentPermissionsnumberThe current permissions as a bitwise integer.
permissionBitnumberThe permission bit to check for.
Returns:
Returns true if the permission bit is present in the current permissions, false otherwise.
Type: 
boolean

verifyJWT(token, publicKey) → {object|null}

Verifies the given JWT using the provided public key.
Parameters:
NameTypeDescription
tokenstringThe JWT to be verified.
publicKeystringThe public key to verify the JWT signature.
Throws:
Throws an error if verification fails.
Type
JsonWebTokenError
Returns:
The decoded JWT payload if the verification is successful, null otherwise.
Type: 
object | null