9.0.2 • Published 2 years ago
@wiitate/guard-sdk v9.0.2
@wiitate/guard-sdk
This package is a plugin for nestjs
Checking JWT as the valid token for authentication
Modify Swagger API doc to display Endpoint premission
Usage
- GuardModule
@Module({
imports: [
GuardModule,
...,
],
})
export class AppModule {}
- @Guard()
@Get('')
@Auth(AccountTypeEnum.User)
...
controller() {
...
}
- injectEndpointPolicyToSwaggerMetadata()
export async function initializeSwagger(app: NestExpressApplication) {
await injectEndpointPolicyToSwaggerMetadata(app);
}