import React from "react"; import { useTranslation } from "react-i18next"; import { I18nKey } from "#/i18n/declaration"; import AllHandsLogo from "#/assets/branding/all-hands-logo.svg?react"; import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop"; import { ModalBody } from "#/components/shared/modals/modal-body"; import { BrandButton } from "../settings/brand-button"; import GitHubLogo from "#/assets/branding/github-logo.svg?react"; import GitLabLogo from "#/assets/branding/gitlab-logo.svg?react"; import { useAuthUrl } from "#/hooks/use-auth-url"; import { GetConfigResponse } from "#/api/open-hands.types"; interface AuthModalProps { githubAuthUrl: string | null; appMode?: GetConfigResponse["APP_MODE"] | null; } export function AuthModal({ githubAuthUrl, appMode }: AuthModalProps) { const { t } = useTranslation(); const gitlabAuthUrl = useAuthUrl({ appMode: appMode || null, identityProvider: "gitlab", }); const handleGitHubAuth = () => { if (githubAuthUrl) { // Always start the OIDC flow, let the backend handle TOS check window.location.href = githubAuthUrl; } }; const handleGitLabAuth = () => { if (gitlabAuthUrl) { // Always start the OIDC flow, let the backend handle TOS check window.location.href = gitlabAuthUrl; } }; return (

{t(I18nKey.AUTH$SIGN_IN_WITH_IDENTITY_PROVIDER)}

} > {t(I18nKey.GITHUB$CONNECT_TO_GITHUB)} } > {t(I18nKey.GITLAB$CONNECT_TO_GITLAB)}
); }