1.0.5 • Published 5 years ago

@diy-kitchens/webtoken v1.0.5

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

Ultima Web Token

TokenService

Create with secret to encode/decode:

const service = new TokenService('secret');

provides decode, create, validate, hasAccess methods for dealing with Ultima tokens

extractTokens

Reads tokens from Ultima style authorisation header, returns interface:

export interface ITokens { applicationId: string; applicationToken: string; universalToken: string; userToken: string; }

Sample usage:

const tokens: ITokens = getTokens(authheaderString, 'Universal');