Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

prevent passport init when envs are undefined

Maidul Islam73aa01c5684e
diff --git a/backend/src/utils/setup/index.ts b/backend/src/utils/setup/index.ts
index e0d035a986..ba6c4b618c 100644
--- a/backend/src/utils/setup/index.ts
+++ b/backend/src/utils/setup/index.ts
@@ -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.