fix docker build

This commit is contained in:
KMKoushik
2025-03-18 21:51:38 +11:00
parent 0fc27d8d7e
commit 2ddafe26b2

View File

@@ -44,6 +44,7 @@ declare module "next-auth" {
* Auth providers * Auth providers
*/ */
function getProviders() {
const providers: Provider[] = []; const providers: Provider[] = [];
if (env.GITHUB_ID && env.GITHUB_SECRET) { if (env.GITHUB_ID && env.GITHUB_SECRET) {
@@ -80,10 +81,13 @@ if (env.FROM_EMAIL) {
); );
} }
if (providers.length === 0) { if (providers.length === 0 && process.env.SKIP_ENV_VALIDATION !== "true") {
throw new Error("No auth providers found, need atleast one"); throw new Error("No auth providers found, need atleast one");
} }
return providers;
}
/** /**
* Options for NextAuth.js used to configure adapters, providers, callbacks, etc. * Options for NextAuth.js used to configure adapters, providers, callbacks, etc.
* *
@@ -116,7 +120,7 @@ export const authOptions: NextAuthOptions = {
} }
}, },
}, },
providers, providers: getProviders(),
}; };
/** /**