1
0
mirror of https://github.com/Infisical/infisical.git synced 2025-03-31 22:09:57 +00:00

prevent passport init when envs are undefined

This commit is contained in:
Maidul Islam
2023-06-03 12:20:04 -07:00
parent b926601a29
commit 73aa01c568

@ -20,7 +20,9 @@ import {
import {
getNodeEnv,
getMongoURL,
getSentryDSN
getSentryDSN,
getClientSecretGoogle,
getClientIdGoogle
} from '../../config';
import { initializePassport } from '../auth';
@ -46,7 +48,13 @@ export const setup = async () => {
// initializing the database connection
await DatabaseService.initDatabase(await getMongoURL());
await initializePassport();
const googleClientSecret: string = await getClientSecretGoogle();
const googleClientId: string = await getClientIdGoogle();
if (googleClientId && googleClientSecret) {
await initializePassport();
}
/**
* NOTE: the order in this setup function is critical.