0.4.1 • Published 12 months ago

@sqrtthree/wrapped-jwt v0.4.1

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

wrapped-jwt

Install

npm install @sqrtthree/wrapped-jwt

API

By Default, it will load app.name as default value of issuer, app.keys as default value of secret with node-config.

signToken(payload: Record<string, any>, subject?: string, options?: SignTokenOptions): Promise<string>

Sign a jwt token.

parseToken<T>(token: string, subject?: string, issuer?: string, options?: VerifyTokenOptions): Promise<T>

Parse and verify jwt token.

parseTokenWithoutVerify<T>(token: string): T

Parse jwt token without verify.

verifyToken(token: string, subject?: string, issuer?: string, options?: VerifyTokenOptions): Promise<void>

Verify jwt token if is valid. it will throw an error if the token is invalid.

0.4.1

12 months ago

0.4.0

12 months ago

0.3.2

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.3.1

3 years ago

0.1.0

3 years ago