mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 16:27:46 +00:00
prevent passport init when envs are undefined
This commit is contained in:
@@ -20,7 +20,9 @@ import {
|
|||||||
import {
|
import {
|
||||||
getNodeEnv,
|
getNodeEnv,
|
||||||
getMongoURL,
|
getMongoURL,
|
||||||
getSentryDSN
|
getSentryDSN,
|
||||||
|
getClientSecretGoogle,
|
||||||
|
getClientIdGoogle
|
||||||
} from '../../config';
|
} from '../../config';
|
||||||
import { initializePassport } from '../auth';
|
import { initializePassport } from '../auth';
|
||||||
|
|
||||||
@@ -46,7 +48,13 @@ export const setup = async () => {
|
|||||||
|
|
||||||
// initializing the database connection
|
// initializing the database connection
|
||||||
await DatabaseService.initDatabase(await getMongoURL());
|
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.
|
* NOTE: the order in this setup function is critical.
|
||||||
|
|||||||
Reference in New Issue
Block a user