The name to be used for accessing the JWT functionality in the Elysia context
Optional
Readonly
expJWT expiration setting. Applies as the default expiration for tokens.
Controls how long tokens are valid before they expire. This setting provides a good balance between security (limiting the window of opportunity for token misuse) and user experience (not requiring frequent re-authentication).
Optional
Readonly
headerDefault JWT header parameters to include in every JWT.
This allows you to specify additional metadata about the token.
Optional
Readonly
jwtJWT name to add in context with decorate.
This allows you to customize how you access the JWT functionality in your
route handlers. For example, if set to 'auth', you would use auth.sign()
instead of the default jwt.sign()
.
Optional
Readonly
payloadDefault payload values to include in every JWT.
These values are merged with any additional payload provided during signing, allowing you to set standard claims that should be included in all tokens generated by your application.
Readonly
secretSecret key used to sign and verify JWTs.
Configuration options for the JWT plugin.
Example