11import { MiddlewareConsumer , ModuleMetadata , Provider , RequestMethod } from '@nestjs/common' ;
2- import { JwtModule , JwtService } from '@nestjs/jwt' ;
2+ import { JwtModule } from '@nestjs/jwt' ;
33import { PassportModule } from '@nestjs/passport' ;
44import passport from 'passport' ;
55import { AuthProviderEnum , PassportStrategyEnum } from '@novu/shared' ;
@@ -10,15 +10,12 @@ import { UserModule } from '../user/user.module';
1010import { USE_CASES } from './usecases' ;
1111import { SharedModule } from '../shared/shared.module' ;
1212import { GitHubStrategy } from './services/passport/github.strategy' ;
13- import { OrganizationModule } from '../organization/organization.module' ;
1413import { EnvironmentsModuleV1 } from '../environments-v1/environments-v1.module' ;
1514import { JwtSubscriberStrategy } from './services/passport/subscriber-jwt.strategy' ;
1615import { RootEnvironmentGuard } from './framework/root-environment-guard.service' ;
1716import { ApiKeyStrategy } from './services/passport/apikey.strategy' ;
1817import { AuthService } from './services/auth.service' ;
19- import { RolesGuard } from './framework/roles.guard' ;
2018import { CommunityAuthService } from './services/community.auth.service' ;
21- import { CommunityUserAuthGuard } from './framework/community.user.auth.guard' ;
2219
2320const AUTH_STRATEGIES : Provider [ ] = [ JwtStrategy , ApiKeyStrategy , JwtSubscriberStrategy ] ;
2421
@@ -39,7 +36,7 @@ export function getCommunityAuthModuleConfig(): ModuleMetadata {
3936 } ) ,
4037 ] ;
4138
42- const baseProviders = [ ...AUTH_STRATEGIES , AuthService , RolesGuard , RootEnvironmentGuard ] ;
39+ const baseProviders = [ ...AUTH_STRATEGIES , AuthService , RootEnvironmentGuard ] ;
4340
4441 // Wherever is the string token used, override it with the provider
4542 const injectableProviders = [
@@ -59,22 +56,16 @@ export function getCommunityAuthModuleConfig(): ModuleMetadata {
5956 provide : 'AUTH_SERVICE' ,
6057 useClass : CommunityAuthService ,
6158 } ,
62- {
63- provide : 'USER_AUTH_GUARD' ,
64- useClass : CommunityUserAuthGuard ,
65- } ,
6659 ] ;
6760
6861 return {
69- imports : [ ...baseImports , EnvironmentsModuleV1 , SharedModule , UserModule , OrganizationModule ] ,
62+ imports : [ ...baseImports , EnvironmentsModuleV1 , SharedModule , UserModule ] ,
7063 controllers : [ AuthController ] ,
7164 providers : [ ...baseProviders , ...injectableProviders , ...USE_CASES ] ,
7265 exports : [
73- RolesGuard ,
7466 RootEnvironmentGuard ,
7567 AuthService ,
7668 'AUTH_SERVICE' ,
77- 'USER_AUTH_GUARD' ,
7869 'USER_REPOSITORY' ,
7970 'MEMBER_REPOSITORY' ,
8071 'ORGANIZATION_REPOSITORY' ,
0 commit comments