add azure-ad login option
This commit is contained in:
committed by
Baptiste Arnaud
parent
e79ff09b0f
commit
ee370b5f26
@ -9,7 +9,7 @@ import {
|
||||
import { useRouter } from 'next/router'
|
||||
import React from 'react'
|
||||
import { stringify } from 'qs'
|
||||
import { FacebookLogo, GoogleLogo, GitlabLogo } from 'assets/logos'
|
||||
import { FacebookLogo, GoogleLogo, GitlabLogo, AzureAdLogo } from 'assets/logos'
|
||||
import { BuiltInProviderType } from 'next-auth/providers'
|
||||
|
||||
type Props = {
|
||||
@ -42,6 +42,11 @@ export const SocialLoginButtons = ({ providers }: Props) => {
|
||||
callbackUrl: `/typebots?${stringify(query)}`,
|
||||
})
|
||||
|
||||
const handleAzureAdClick = async () =>
|
||||
signIn('azure-ad', {
|
||||
callbackUrl: `/typebots?${stringify(query)}`,
|
||||
})
|
||||
|
||||
return (
|
||||
<Stack>
|
||||
{providers?.github && (
|
||||
@ -88,6 +93,17 @@ export const SocialLoginButtons = ({ providers }: Props) => {
|
||||
Continue with {providers.gitlab.name}
|
||||
</Button>
|
||||
)}
|
||||
{providers?.['azure-ad'] && (
|
||||
<Button
|
||||
leftIcon={<AzureAdLogo />}
|
||||
onClick={handleAzureAdClick}
|
||||
data-testid='azure-ad'
|
||||
isLoading={['loading', 'authenticated'].includes(status)}
|
||||
variant="outline"
|
||||
>
|
||||
Continue with {providers['azure-ad'].name}
|
||||
</Button>
|
||||
)}
|
||||
</Stack>
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user