Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@constlab/vesper-jwt-auth

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@constlab/vesper-jwt-auth - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

2

package.json
{
"name": "@constlab/vesper-jwt-auth",
"version": "0.0.4",
"version": "0.0.5",
"description": "vesper + jwt auth",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -8,1 +8,23 @@ # Vesper JWT Auth

## 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)
```typescript
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)
});
```
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc