@constlab/vesper-jwt-auth
Advanced tools
Comparing version 0.0.4 to 0.0.5
{ | ||
"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) | ||
}); | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
63281
30
0