34 lines
939 B
TypeScript
34 lines
939 B
TypeScript
import { Global, Module } from '@nestjs/common';
|
|
import { APP_GUARD } from '@nestjs/core';
|
|
import { AuthService } from './auth.service';
|
|
import { IdentityResolverGuard } from './identity-resolver.guard';
|
|
import { IdentityService } from './identity.service';
|
|
import { JwtAuthGuard } from './jwt.guard';
|
|
import { JwtService } from './jwt.service';
|
|
import { RolesGuard } from './roles.guard';
|
|
import { UserResolverGuard } from './user-resolver.guard';
|
|
|
|
@Global()
|
|
@Module({
|
|
providers: [
|
|
AuthService,
|
|
JwtService,
|
|
IdentityService,
|
|
JwtAuthGuard,
|
|
IdentityResolverGuard,
|
|
UserResolverGuard,
|
|
RolesGuard,
|
|
{ provide: APP_GUARD, useClass: JwtAuthGuard },
|
|
{ provide: APP_GUARD, useClass: IdentityResolverGuard },
|
|
{ provide: APP_GUARD, useClass: UserResolverGuard },
|
|
],
|
|
exports: [
|
|
AuthService,
|
|
JwtService,
|
|
IdentityService,
|
|
UserResolverGuard,
|
|
RolesGuard,
|
|
],
|
|
})
|
|
export class AuthModule {}
|