Skip to content

Commit

Permalink
fix: show auth0 everywhere except production, hide azure login if env…
Browse files Browse the repository at this point in the history
… not set
  • Loading branch information
rschlaefli committed Sep 20, 2023
1 parent 926744e commit d7be55d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/lib/authOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ export const authOptions: NextAuthOptions = {
// },
// from: process.env.EMAIL_FROM,
// }),
AzureADProvider({
clientId: process.env.AZURE_AD_CLIENT_ID as string,
clientSecret: process.env.AZURE_AD_CLIENT_SECRET as string,
tenantId: process.env.AZURE_AD_TENANT_ID as string,
}),
process.env.NODE_ENV === 'development' &&
typeof process.env.AZURE_AD_CLIENT_ID === 'string' &&
AzureADProvider({
clientId: process.env.AZURE_AD_CLIENT_ID as string,
clientSecret: process.env.AZURE_AD_CLIENT_SECRET as string,
tenantId: process.env.AZURE_AD_TENANT_ID as string,
}),
process.env.NODE_ENV !== 'production' &&
(Auth0Provider({
clientId: process.env.AUTH0_CLIENT_ID as string,
clientSecret: process.env.AUTH0_CLIENT_SECRET as string,
Expand Down

0 comments on commit d7be55d

Please sign in to comment.