Avoid optional Fortify route imports
linter / quality (pull_request) Successful in 1m22s
tests / ci (8.4) (pull_request) Successful in 1m35s

This commit is contained in:
2026-05-22 23:33:01 +00:00
parent fd0d6ac6d6
commit 94e32497b0
14 changed files with 76 additions and 32 deletions
+3 -2
View File
@@ -5,8 +5,8 @@ import PasswordInput from '@/components/PasswordInput.vue';
import { Button } from '@/components/ui/button';
import { Label } from '@/components/ui/label';
import { Spinner } from '@/components/ui/spinner';
import { fortifyRoutes } from '@/lib/fortify';
import AuthLayout from '@/layouts/AuthLayout.vue';
import { store } from '@/routes/password/confirm';
</script>
<template>
@@ -17,7 +17,8 @@ import { store } from '@/routes/password/confirm';
<Head title="Confirm password" />
<Form
v-bind="store.form()"
:action="fortifyRoutes.password.confirm"
method="post"
reset-on-success
v-slot="{ errors, processing }"
>
+6 -2
View File
@@ -6,9 +6,9 @@ import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Spinner } from '@/components/ui/spinner';
import { fortifyRoutes } from '@/lib/fortify';
import AuthLayout from '@/layouts/AuthLayout.vue';
import { login } from '@/routes/index';
import { email } from '@/routes/password';
defineProps<{
status?: string;
@@ -30,7 +30,11 @@ defineProps<{
</div>
<div class="space-y-6">
<Form v-bind="email.form()" v-slot="{ errors, processing }">
<Form
:action="fortifyRoutes.password.email"
method="post"
v-slot="{ errors, processing }"
>
<div class="grid gap-2">
<Label for="email">Email address</Label>
<Input
+5 -4
View File
@@ -8,10 +8,9 @@ import { Checkbox } from '@/components/ui/checkbox';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Spinner } from '@/components/ui/spinner';
import { fortifyRoutes } from '@/lib/fortify';
import AuthBase from '@/layouts/AuthLayout.vue';
import { register } from '@/routes/index';
import { store } from '@/routes/login';
import { request } from '@/routes/password';
defineProps<{
status?: string;
@@ -61,7 +60,7 @@ defineProps<{
<Label for="password">Password</Label>
<TextLink
v-if="canResetPassword"
:href="request()"
:href="fortifyRoutes.password.request"
class="text-sm"
:tabindex="5"
>
@@ -103,7 +102,9 @@ defineProps<{
v-if="canRegister"
>
Don't have an account?
<TextLink :href="register()" :tabindex="5">Sign up</TextLink>
<TextLink :href="fortifyRoutes.register.create" :tabindex="5">
Sign up
</TextLink>
</div>
</Form>
</AuthBase>
+3 -2
View File
@@ -7,9 +7,9 @@ import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Spinner } from '@/components/ui/spinner';
import { fortifyRoutes } from '@/lib/fortify';
import AuthBase from '@/layouts/AuthLayout.vue';
import { login } from '@/routes/index';
import { store } from '@/routes/register';
</script>
<template>
@@ -20,7 +20,8 @@ import { store } from '@/routes/register';
<Head title="Register" />
<Form
v-bind="store.form()"
:action="fortifyRoutes.register.store"
method="post"
:reset-on-success="['password', 'password_confirmation']"
v-slot="{ errors, processing }"
class="flex flex-col gap-6"
+3 -2
View File
@@ -7,8 +7,8 @@ import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Spinner } from '@/components/ui/spinner';
import { fortifyRoutes } from '@/lib/fortify';
import AuthLayout from '@/layouts/AuthLayout.vue';
import { update } from '@/routes/password';
const props = defineProps<{
token: string;
@@ -26,7 +26,8 @@ const inputEmail = ref(props.email);
<Head title="Reset password" />
<Form
v-bind="update.form()"
:action="fortifyRoutes.password.update"
method="post"
:transform="(data) => ({ ...data, token, email })"
:reset-on-success="['password', 'password_confirmation']"
v-slot="{ errors, processing }"
@@ -9,8 +9,8 @@ import {
InputOTPGroup,
InputOTPSlot,
} from '@/components/ui/input-otp';
import { fortifyRoutes } from '@/lib/fortify';
import AuthLayout from '@/layouts/AuthLayout.vue';
import { store } from '@/routes/two-factor/login';
import type { TwoFactorConfigContent } from '@/types';
const authConfigContent = computed<TwoFactorConfigContent>(() => {
@@ -52,7 +52,8 @@ const code = ref<string>('');
<div class="space-y-6">
<template v-if="!showRecoveryInput">
<Form
v-bind="store.form()"
:action="fortifyRoutes.twoFactor.challenge"
method="post"
class="space-y-4"
reset-on-error
@error="code = ''"
@@ -99,7 +100,8 @@ const code = ref<string>('');
<template v-else>
<Form
v-bind="store.form()"
:action="fortifyRoutes.twoFactor.challenge"
method="post"
class="space-y-4"
reset-on-error
#default="{ errors, processing, clearErrors }"
+3 -2
View File
@@ -3,9 +3,9 @@ import { Form, Head } from '@inertiajs/vue3';
import TextLink from '@/components/TextLink.vue';
import { Button } from '@/components/ui/button';
import { Spinner } from '@/components/ui/spinner';
import { fortifyRoutes } from '@/lib/fortify';
import AuthLayout from '@/layouts/AuthLayout.vue';
import { logout } from '@/routes/index';
import { send } from '@/routes/verification';
defineProps<{
status?: string;
@@ -28,7 +28,8 @@ defineProps<{
</div>
<Form
v-bind="send.form()"
:action="fortifyRoutes.verification.send"
method="post"
class="space-y-6 text-center"
v-slot="{ processing }"
>