1.0.7 • Published 6 years ago

@nutility/jwt v1.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

@nutility/jwt

JWT Wrapper module for NestJS

Usage

Import NutilityJwtModule

NutilityJwtService exposes 3 methods (sign, verify, decode), which are native mappings to jsonwebtoken

You can specify a type for those methods: Example:

interface IUser {
  id: string;
  name: string;
}

const token = nutilityJwtService.sign<IUser>(foo); // foo must be of type IUser!
const user = nutilityJwtService.verify<IUser>(token); // user is of type IUser!
const decodedUser = nutilityJwtService.decode<IUser>(token); // decodedUser is of type IUser!
1.0.7

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago