Skip to content

BeechCMS


BeechCMS / @beechcms/core / ITokenService

Interface: ITokenService ​

Methods ​

issue() ​

issue(claims, options?): Promise<string>

Issues a signed JWT for the given claims. The token is short-lived by design; callers that need a longer-lived session should use a refresh token instead.

Parameters ​

claims ​

JwtClaims

options? ​

IssueTokenOptions

Returns ​

Promise<string>


verify() ​

verify(token): Promise<JwtClaims | null>

Verifies a JWT and returns its decoded claims, or null on ANY failure (expired, tampered, wrong issuer/audience, malformed). Never throws.

Parameters ​

token ​

string

Returns ​

Promise<JwtClaims | null>