@@ -7,6 +7,7 @@ import { signIn } from "next-auth/react";
77import React , { useState } from "react" ;
88
99import logo from "@/assets/logo/logo.svg" ;
10+ import { AzureButton } from "@/components/auth/azure-button" ;
1011import { EmailSignInButton } from "@/components/auth/email-sign-in" ;
1112import { GitHubButton } from "@/components/auth/github-button" ;
1213import { GoogleButton } from "@/components/auth/google-button" ;
@@ -16,14 +17,15 @@ interface SignInProps {
1617 callbackUrl : string ;
1718 enableGoogle ?: boolean ;
1819 enableGithub ?: boolean ;
20+ enableAzure ?: boolean ;
1921 enableCredentials ?: boolean ;
2022}
2123
22- type Provider = "github" | "google" ;
24+ type Provider = "github" | "google" | "azure-ad" ;
2325
2426const defaultErrorMessage = `Failed to sign in. Please try again.` ;
2527
26- const SignIn = ( { callbackUrl, enableGoogle, enableGithub, enableCredentials } : SignInProps ) => {
28+ const SignIn = ( { callbackUrl, enableGoogle, enableGithub, enableAzure , enableCredentials } : SignInProps ) => {
2729 const searchParams = useSearchParams ( ) ;
2830 const [ error , setError ] = useState ( searchParams . get ( "error" ) ) ;
2931 const [ isLoading , setIsLoading ] = useState < Provider | string > ( "" ) ;
@@ -58,7 +60,6 @@ const SignIn = ({ callbackUrl, enableGoogle, enableGithub, enableCredentials }:
5860 onClick = { ( ) => handleSignIn ( "google" ) }
5961 isLoading = { isLoading === "google" }
6062 isDisabled = { ! ! isLoading }
61- callbackUrl = { callbackUrl }
6263 />
6364 ) }
6465 { enableGithub && (
@@ -69,7 +70,16 @@ const SignIn = ({ callbackUrl, enableGoogle, enableGithub, enableCredentials }:
6970 className = { cn ( {
7071 "w-full" : enableCredentials ,
7172 } ) }
72- callbackUrl = { callbackUrl }
73+ />
74+ ) }
75+ { enableAzure && (
76+ < AzureButton
77+ onClick = { ( ) => handleSignIn ( "azure-ad" ) }
78+ isLoading = { isLoading === "azure-ad" }
79+ isDisabled = { ! ! isLoading }
80+ className = { cn ( {
81+ "w-full" : enableCredentials ,
82+ } ) }
7383 />
7484 ) }
7585 { error && < span className = "text-destructive text-xs mt-4" > { defaultErrorMessage } </ span > }
@@ -85,11 +95,11 @@ const SignIn = ({ callbackUrl, enableGoogle, enableGithub, enableCredentials }:
8595 { ! enableCredentials && (
8696 < div className = "text-sm font-medium text-white/70" >
8797 By continuing you agree to our{ " " }
88- < a href = "https://docs.lmnr.ai/ policies/privacy-policy " target = "_blank" className = "text-white" >
98+ < a href = "/ policies/privacy" target = "_blank" className = "text-white" >
8999 Privacy Policy
90100 </ a > { " " }
91101 and{ " " }
92- < a href = "https://docs.lmnr.ai/ policies/terms-of-service " target = "_blank" className = "text-white" >
102+ < a href = "/ policies/terms" target = "_blank" className = "text-white" >
93103 Terms of Service
94104 </ a >
95105 </ div >
0 commit comments