🧑‍💻 Add keycloak auth provider (#1533)

#1529
This commit is contained in:
Jeanluca
2024-05-23 10:36:30 -03:00
committed by GitHub
parent 29040c67e1
commit bb4bbd8f0e
13 changed files with 76 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ import { AzureAdLogo } from '@/components/logos/AzureAdLogo'
import { FacebookLogo } from '@/components/logos/FacebookLogo'
import { GitlabLogo } from '@/components/logos/GitlabLogo'
import { useTranslate } from '@tolgee/react'
import { KeycloackLogo } from '@/components/logos/KeycloakLogo'
type Props = {
providers:
@@ -52,6 +53,8 @@ export const SocialLoginButtons = ({ providers }: Props) => {
const handleCustomOAuthClick = () => handleSignIn('custom-oauth')
const handleKeyCloackClick = () => handleSignIn('keycloak')
return (
<Stack>
{providers?.github && (
@@ -142,6 +145,20 @@ export const SocialLoginButtons = ({ providers }: Props) => {
})}
</Button>
)}
{providers?.keycloak && (
<Button
leftIcon={<KeycloackLogo />}
onClick={handleKeyCloackClick}
data-testid="keycloak"
isLoading={
['loading', 'authenticated'].includes(status) ||
authLoading === 'keycloak'
}
variant="outline"
>
{t('auth.socialLogin.keycloakButton.label')}
</Button>
)}
</Stack>
)
}