diff --git a/src/app/[locale]/(protected)/settings/security/page.tsx b/src/app/[locale]/(protected)/settings/security/page.tsx index bab5416..04577ee 100644 --- a/src/app/[locale]/(protected)/settings/security/page.tsx +++ b/src/app/[locale]/(protected)/settings/security/page.tsx @@ -1,12 +1,17 @@ import { DeleteAccountCard } from '@/components/settings/security/delete-account-card'; import { PasswordCardWrapper } from '@/components/settings/security/password-card-wrapper'; +import { websiteConfig } from '@/config/website'; export default function SecurityPage() { + const credentialLoginEnabled = websiteConfig.auth.enableCredentialLogin; + return (
-
- -
+ {credentialLoginEnabled && ( +
+ +
+ )}
diff --git a/src/components/auth/login-form.tsx b/src/components/auth/login-form.tsx index 8538de9..4f29a7c 100644 --- a/src/components/auth/login-form.tsx +++ b/src/components/auth/login-form.tsx @@ -57,6 +57,9 @@ export const LoginForm = ({ const [isPending, setIsPending] = useState(false); const [showPassword, setShowPassword] = useState(false); + // Check if credential login is enabled + const credentialLoginEnabled = websiteConfig.auth.enableCredentialLogin; + // turnstile captcha schema const turnstileEnabled = websiteConfig.features.enableTurnstileCaptcha; const captchaSiteKey = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY; @@ -148,102 +151,111 @@ export const LoginForm = ({ bottomButtonHref={`${Routes.Register}`} className={cn('', className)} > -
- -
- ( - - {t('email')} - - - - - - )} - /> - ( - -
- {t('password')} - -
- -
+ {credentialLoginEnabled && ( + + +
+ ( + + {t('email')} + + + + + )} + /> + ( + +
+ {t('password')}
- - -
+ +
+ + +
+
+ + + )} + /> +
+ + + {captchaConfigured && ( + form.setValue('captchaToken', token)} + validationError={form.formState.errors.captchaToken?.message} + /> + )} +
- - - {captchaConfigured && ( - form.setValue('captchaToken', token)} - validationError={form.formState.errors.captchaToken?.message} - /> - )} - - - + {t('signIn')} + + + + )}
- +
); diff --git a/src/components/auth/register-form.tsx b/src/components/auth/register-form.tsx index 20efd17..9ed63b7 100644 --- a/src/components/auth/register-form.tsx +++ b/src/components/auth/register-form.tsx @@ -52,6 +52,9 @@ export const RegisterForm = ({ const [isPending, setIsPending] = useState(false); const [showPassword, setShowPassword] = useState(false); + // Check if credential login is enabled + const credentialLoginEnabled = websiteConfig.auth.enableCredentialLogin; + // turnstile captcha schema const turnstileEnabled = websiteConfig.features.enableTurnstileCaptcha; const captchaSiteKey = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY; @@ -156,100 +159,113 @@ export const RegisterForm = ({ bottomButtonLabel={t('signInHint')} bottomButtonHref={`${Routes.Login}`} > -
- -
- ( - - {t('name')} - - - - - - )} - /> - ( - - {t('email')} - - - - - - )} - /> - ( - - {t('password')} - -
+ {credentialLoginEnabled && ( + + +
+ ( + + {t('name')} + - -
- - - + placeholder="name@example.com" + type="email" + /> + + + + )} + /> + ( + + {t('password')} + +
+ + +
+
+ +
+ )} + /> +
+ + + {captchaConfigured && ( + form.setValue('captchaToken', token)} + validationError={form.formState.errors.captchaToken?.message} + /> + )} +
- - - {captchaConfigured && ( - form.setValue('captchaToken', token)} - validationError={form.formState.errors.captchaToken?.message} - /> - )} - - - + {t('signUp')} + + + + )}
- +
); diff --git a/src/components/auth/social-login-button.tsx b/src/components/auth/social-login-button.tsx index f8e42ce..5418b52 100644 --- a/src/components/auth/social-login-button.tsx +++ b/src/components/auth/social-login-button.tsx @@ -15,6 +15,7 @@ import { useState } from 'react'; interface SocialLoginButtonProps { callbackUrl?: string; + showDivider?: boolean; } /** @@ -22,6 +23,7 @@ interface SocialLoginButtonProps { */ export const SocialLoginButton = ({ callbackUrl: propCallbackUrl, + showDivider = true, }: SocialLoginButtonProps) => { if ( !websiteConfig.auth.enableGoogleLogin && @@ -93,7 +95,7 @@ export const SocialLoginButton = ({ return (
- + {showDivider && } {websiteConfig.auth.enableGoogleLogin && (