Skip to content

JwtService

Defined in: packages/auth/src/jwt/jwt.service.ts:104

new JwtService(options): JwtService

Defined in: packages/auth/src/jwt/jwt.service.ts:109

JwtServiceOptions

JwtService

get tokenLifetimeSeconds(): number

Defined in: packages/auth/src/jwt/jwt.service.ts:119

Lifetime of issued tokens, in seconds.

number

issue(input, issuedAt?): string

Defined in: packages/auth/src/jwt/jwt.service.ts:128

Issue a signed token for the given principal.

JwtIssueInput

number = ...

string


issueWithClaims(input, issuedAt?): object

Defined in: packages/auth/src/jwt/jwt.service.ts:137

Issue a signed token and also return its claims, so callers can bind the minted jti/exp to server-side state (e.g. a session, for revocation on logout) without re-verifying the token they just produced.

JwtIssueInput

number = ...

object

claims: JwtClaims

token: string


verify(token, atSeconds?): JwtClaims

Defined in: packages/auth/src/jwt/jwt.service.ts:169

Verify a token and return its claims, or throw JwtError.

Validation order is signature → structure → issuer → expiry so that a tampered token never reaches claim parsing.

string

number = ...

JwtClaims