Extract an array of permission strings from a JWT payload.
Many authorization systems encode permissions in a custom claim
(e.g. "permissions", "scope", "roles"). This helper
normalises the value to a readonly string[].
Parameters
token: string
A JWT in compact serialisation.
claimName: string = "permissions"
The claim that holds the permissions.
Defaults to "permissions".
Returns readonlystring[]
A readonly array of permission strings.
Returns an empty array if the claim is absent or not an array.
Extract an array of permission strings from a JWT payload.
Many authorization systems encode permissions in a custom claim (e.g.
"permissions","scope","roles"). This helper normalises the value to areadonly string[].