Function: signJwt()
signJwt(
args):string
Defined in: jwt.ts:47
Signs a JWT with HMAC-SHA256 (HS256).
For Amazon Cognito tokens, use @ttoss/auth-core/amazon-cognito instead —
this helper is meant for self-hosted authentication where the application
owns the signing secret.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | { expiresInSeconds?: number; payload: JwtPayload; secret: string; } | - |
args.expiresInSeconds? | number | Token lifetime in seconds, e.g. 60 * 60 * 24 * 7 for 7 days. When omitted, the token never expires. |
args.payload | JwtPayload | - |
args.secret | string | - |
Returns
string