0.1.0 • Published 6 years ago

@constlab/vesper-jwt-auth v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Vesper JWT Auth

Build Status

Early access. Not for production use

Initial setup

  1. npm i @constlab/vesper-jwt-auth
  2. Add AuthModule to bootstrap
  3. Add UserRepository to DI container
  4. Add authorization checker function
  5. Add salt to parameters (see https://github.com/vesper-framework/vesper/blob/master/src/options/SchemaBuilderOptions.ts#L85)

    import { AuthModule, jwtAuthorizationCheck } from "@constlab/vesper-jwt-auth";
    
    bootstrap({
    	port: 3000,
    	parameters: {
    		"salt": "<random string>"
    	},
    	modules: [AuthModule, UserModule],
    	setupContainer: async (container, action) => {
    		container.set("user.repository", getRepository(User));
    	},
    	authorizationChecker: (roles: string[], action) => jwtAuthorizationCheck(roles, action)
    });
0.1.0

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago