9.0.2 • Published 2 years ago

@wiitate/guard-sdk v9.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

@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

  1. GuardModule
@Module({
  imports: [
    GuardModule,
    ...,
  ],
})
export class AppModule {}
  1. @Guard()
@Get('')
@Auth(AccountTypeEnum.User)
...
controller() {
  ...
}
  1. injectEndpointPolicyToSwaggerMetadata()
export async function initializeSwagger(app: NestExpressApplication) {
  await injectEndpointPolicyToSwaggerMetadata(app);
}