Socket
Socket
Sign inDemoInstall

@constlab/vesper-jwt-auth

Package Overview
Dependencies
19
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @constlab/vesper-jwt-auth

vesper + jwt auth


Version published
Maintainers
3
Created

Readme

Source

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)
});

Keywords

FAQs

Last updated on 12 Sep 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc