feat: remove EmptyClassProvider class

This commit is contained in:
Mir Arif Hasan
2023-07-27 18:56:19 +06:00
parent d090585685
commit 8d59a69f48
2 changed files with 4 additions and 6 deletions

View File

@@ -11,7 +11,7 @@ import { RTJwtStrategy } from './strategies/rt-jwt.strategy';
import { GoogleStrategy } from './strategies/google.strategy';
import { GithubStrategy } from './strategies/github.strategy';
import { MicrosoftStrategy } from './strategies/microsoft.strategy';
import { EmptyClassProvider, authProviderCheck } from './helper';
import { authProviderCheck } from './helper';
@Module({
imports: [
@@ -27,9 +27,9 @@ import { EmptyClassProvider, authProviderCheck } from './helper';
AuthService,
JwtStrategy,
RTJwtStrategy,
authProviderCheck('GOOGLE') ? GoogleStrategy : EmptyClassProvider,
authProviderCheck('GITHUB') ? GithubStrategy : EmptyClassProvider,
authProviderCheck('MICROSOFT') ? MicrosoftStrategy : EmptyClassProvider,
...(authProviderCheck('GOOGLE') ? [GoogleStrategy] : []),
...(authProviderCheck('GITHUB') ? [GithubStrategy] : []),
...(authProviderCheck('MICROSOFT') ? [MicrosoftStrategy] : []),
],
controllers: [AuthController],
})

View File

@@ -98,8 +98,6 @@ export const subscriptionContextCookieParser = (rawCookies: string) => {
};
};
export class EmptyClassProvider {}
/**
* Check to see if given auth provider is present in the ALLOWED_AUTH_PROVIDERS env variable
*