Methods
hasPermission(currentPermissions, permissionBit) → {boolean}
Checks if a given permission bit is present in the current permissions.
Parameters:
| Name | Type | Description |
|---|---|---|
currentPermissions | number | The current permissions as a bitwise integer. |
permissionBit | number | The permission bit to check for. |
- Source
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:
| Name | Type | Description |
|---|---|---|
token | string | The JWT to be verified. |
publicKey | string | The public key to verify the JWT signature. |
- Source
Throws:
- Throws an error if verification fails.
- Type
- JsonWebTokenError
Returns:
The decoded JWT payload if the verification is successful, null otherwise.
- Type:
- object |
null