mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-28 21:57:23 +02:00
✨ Add login with microsoft (#1008)
This commit is contained in:
parent
93f98cffe6
commit
3abd3608be
8 changed files with 104 additions and 40 deletions
|
@ -13,6 +13,7 @@ import { NextAuthOptions, RequestInternal } from "next-auth";
|
|||
import NextAuth, {
|
||||
getServerSession as getServerSessionWithOptions,
|
||||
} from "next-auth/next";
|
||||
import AzureADProvider from "next-auth/providers/azure-ad";
|
||||
import CredentialsProvider from "next-auth/providers/credentials";
|
||||
import EmailProvider from "next-auth/providers/email";
|
||||
import GoogleProvider from "next-auth/providers/google";
|
||||
|
@ -146,6 +147,20 @@ if (process.env.GOOGLE_CLIENT_ID && process.env.GOOGLE_CLIENT_SECRET) {
|
|||
);
|
||||
}
|
||||
|
||||
if (
|
||||
process.env.MICROSOFT_TENANT_ID &&
|
||||
process.env.MICROSOFT_CLIENT_ID &&
|
||||
process.env.MICROSOFT_CLIENT_SECRET
|
||||
) {
|
||||
providers.push(
|
||||
AzureADProvider({
|
||||
tenantId: process.env.MICROSOFT_TENANT_ID,
|
||||
clientId: process.env.MICROSOFT_CLIENT_ID,
|
||||
clientSecret: process.env.MICROSOFT_CLIENT_SECRET,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
const getAuthOptions = (...args: GetServerSessionParams) =>
|
||||
({
|
||||
adapter: CustomPrismaAdapter(prisma),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue