1.0.1 • Published 1 year ago

@neumatter/jwt v1.0.1

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

JWT

JavaScript Style Guide

Table of Contents

Install

npm i @neumatter/jwt

Usage

Signing:

import { JWS, UnsecuredJWT } from '@neumatter/jwt'

const jwt = new UnsecuredJWT({ expiresIn: 'PT4H', id: '123456789' }, { alg: 'HS256' })
const jws = await JWS.sign(jwt, process.env.SECRET_JWT)

Verifying:

import { JWS } from '@neumatter/jwt'

const jws = new JWS(signedString)
const unsecuredJWT = await jws.verify(process.env.SECRET_JWT)