diff --git a/heicode/web/default/src/features/auth/sign-in/index.tsx b/heicode/web/default/src/features/auth/sign-in/index.tsx index 5a55876..207f252 100644 --- a/heicode/web/default/src/features/auth/sign-in/index.tsx +++ b/heicode/web/default/src/features/auth/sign-in/index.tsx @@ -1,12 +1,21 @@ -import { useSearch } from '@tanstack/react-router' +import { Link, useSearch } from '@tanstack/react-router' import { useTranslation } from 'react-i18next' import { ArrowUpRight } from 'lucide-react' +import { useStatus } from '@/hooks/use-status' import { AuthLayout } from '../auth-layout' import { UserAuthForm } from './components/user-auth-form' export function SignIn() { const { t } = useTranslation() const { redirect } = useSearch({ from: '/(auth)/sign-in' }) + const { status } = useStatus() + + const registerEnabled = + status?.register_enabled ?? + status?.data?.register_enabled ?? + status?.password_register_enabled ?? + status?.data?.password_register_enabled ?? + true return ( @@ -47,21 +56,31 @@ export function SignIn() {
-

- {t('Need access?')} -

-

- {t( - 'Account provisioning is handled by your platform administrator. Reach out to the Heicode operator to be added to a tenant.' - )} -

- - {t('Contact tenant operator')} - - + {registerEnabled ? ( + <> +

+ {t("Don't have an account?")} +

+ + {t('Create a new account')} + + + + ) : ( + <> +

+ {t('Need access?')} +

+

+ {t( + 'Account provisioning is handled by your platform administrator. Reach out to the Heicode operator to be added to a tenant.' + )} +

+ + )}