GeezerVison is showing github.com — GitHub - constlab/vesper-jwt-auth
Folders and files
| Name | Name | Last commit message | Last commit date |
|---|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
|
Repository files navigation

Early access. Not for production use
npm i @constlab/vesper-jwt-auth
- Add
AuthModule to bootstrap
- Add
UserRepository to DI container
- Add authorization checker function
- 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)
});
About
No description or website provided.
Topics
Resources
Stars
1 star
Watchers
2 watching
Forks