fix(auth): corrected password reset navigation guard (#310)

This commit is contained in:
Corentin Thomasset
2025-05-26 22:19:33 +02:00
committed by GitHub
parent d4f72e889a
commit 91d2e236d0
3 changed files with 7 additions and 5 deletions

View File

@@ -86,9 +86,11 @@ export const EmailLoginForm: Component = () => {
)}
</Field>
<Button variant="link" as={A} class="inline p-0! h-auto" href="/request-password-reset">
{t('auth.login.form.forgot-password.label')}
</Button>
<Show when={config.auth.isPasswordResetEnabled}>
<Button variant="link" as={A} class="inline p-0! h-auto" href="/request-password-reset">
{t('auth.login.form.forgot-password.label')}
</Button>
</Show>
</div>
<Button type="submit" class="w-full">{t('auth.login.form.submit')}</Button>

View File

@@ -58,7 +58,7 @@ export const RequestPasswordResetPage: Component = () => {
const navigate = useNavigate();
onMount(() => {
if (config.auth.isPasswordResetEnabled) {
if (!config.auth.isPasswordResetEnabled) {
navigate('/login');
}
});

View File

@@ -62,7 +62,7 @@ export const ResetPasswordPage: Component = () => {
const navigate = useNavigate();
onMount(() => {
if (config.auth.isPasswordResetEnabled) {
if (!config.auth.isPasswordResetEnabled) {
navigate('/login');
}
});