temp test

This commit is contained in:
Khalim Conn-Kowlessar 2024-09-10 17:16:17 +01:00
parent 1d0fab8ec5
commit 345cfc670a
2 changed files with 17 additions and 1 deletions

View file

@ -4,6 +4,7 @@ import AzureADB2CProvider from "next-auth/providers/azure-ad-b2c";
import { db } from "@/app/db/db";
import { user as userTable, User } from "@/app/db/schema/users";
import { eq } from "drizzle-orm";
import AzureADProvider from "next-auth/providers/azure-ad";
const { GOOGLE_CLIENT_ID = "", GOOGLE_CLIENT_SECRET = "" } = process.env;
const {
@ -11,6 +12,9 @@ const {
AZURE_AD_B2C_CLIENT_ID = "",
AZURE_AD_B2C_CLIENT_SECRET = "",
AZURE_AD_B2C_PRIMARY_USER_FLOW = "",
AZURE_AD_B2B_CLIENT_ID = "",
AZURE_AD_B2B_CLIENT_SECRET = "",
AZURE_AD_B2B_TENANT_ID = "",
} = process.env;
type OauthProvider = "google";
@ -45,6 +49,17 @@ export const AuthOptions: NextAuthOptions = {
},
},
}),
AzureADProvider({
clientId: AZURE_AD_B2B_CLIENT_ID,
clientSecret: AZURE_AD_B2B_CLIENT_SECRET,
tenantId: AZURE_AD_B2B_TENANT_ID,
authorization: {
params: {
scope: "openid profile email",
prompt: "login",
},
},
}),
],
pages: {
signIn: "/",

View file

@ -13,7 +13,8 @@ const MicrosoftSignInButton = () => {
<Button
data-testid="microsoft-signin-btn"
className="text-black hover:text-gray-400 text-xl hover:bg-gray-100 rounded-lg p-0"
onClick={() => signIn("azure-ad-b2c", { callbackUrl })} // Note the provider ID "azure-ad" must match the one you've set in NextAuth config
// onClick={() => signIn("azure-ad-b2c", { callbackUrl })} // Note the provider ID "azure-ad" must match the one you've set in NextAuth config
onClick={() => signIn("azure-ad", { callbackUrl })} // Note the provider ID "azure-ad" must match the one you've set in NextAuth config
>
<svg
xmlns="http://www.w3.org/2000/svg"