fix docker build
This commit is contained in:
@@ -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(),
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user