wip(freight): migration 0017 + model/column-list groundwork for add-freight-templates
This commit is contained in:
+32
-15
@@ -19,7 +19,9 @@ const submitting = ref(false);
|
||||
const redirectTarget = computed((): string => {
|
||||
const raw = route.query.redirect;
|
||||
const value = Array.isArray(raw) ? raw[0] : raw;
|
||||
return typeof value === "string" && value.startsWith("/") && !value.startsWith("//") ? value : "/";
|
||||
return typeof value === "string" && value.startsWith("/") && !value.startsWith("//")
|
||||
? value
|
||||
: "/";
|
||||
});
|
||||
|
||||
function validate(): boolean {
|
||||
@@ -45,9 +47,10 @@ async function submit(): Promise<void> {
|
||||
session.setAuth(auth);
|
||||
await router.push(redirectTarget.value);
|
||||
} catch (error) {
|
||||
errorKey.value = error instanceof ApiError && error.status === 401
|
||||
? "auth.invalidCredentials"
|
||||
: "auth.requestFailed";
|
||||
errorKey.value =
|
||||
error instanceof ApiError && error.status === 401
|
||||
? "auth.invalidCredentials"
|
||||
: "auth.requestFailed";
|
||||
} finally {
|
||||
submitting.value = false;
|
||||
}
|
||||
@@ -55,31 +58,45 @@ async function submit(): Promise<void> {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="min-h-screen bg-bg px-5 py-10 font-sans text-text">
|
||||
<section class="bg-bg text-text min-h-screen px-5 py-10 font-sans">
|
||||
<VCard class="mx-auto my-10 max-w-[420px] p-6 sm:p-10">
|
||||
<div class="mb-7 flex items-baseline gap-4 border-b border-border pb-3.5">
|
||||
<div class="border-border mb-7 flex items-baseline gap-4 border-b pb-3.5">
|
||||
<h1 class="m-0 text-xl font-semibold">{{ t("auth.loginTab") }}</h1>
|
||||
<NuxtLink class="text-sm text-primary hover:text-primary-hover" to="/register">{{ t("auth.registerTab") }}</NuxtLink>
|
||||
<NuxtLink class="text-primary hover:text-primary-hover text-sm" to="/register">{{
|
||||
t("auth.registerTab")
|
||||
}}</NuxtLink>
|
||||
</div>
|
||||
<form @submit.prevent="submit">
|
||||
<VField :label="t('common.email')">
|
||||
<VInput v-model.trim="email" type="email" autocomplete="email" :placeholder="t('auth.emailPlaceholder')" />
|
||||
<VInput
|
||||
v-model.trim="email"
|
||||
type="email"
|
||||
autocomplete="email"
|
||||
:placeholder="t('auth.emailPlaceholder')"
|
||||
/>
|
||||
</VField>
|
||||
<VField :label="t('common.password')">
|
||||
<VInput v-model="password" type="password" autocomplete="current-password" :placeholder="t('auth.passwordPlaceholder')" />
|
||||
<VInput
|
||||
v-model="password"
|
||||
type="password"
|
||||
autocomplete="current-password"
|
||||
:placeholder="t('auth.passwordPlaceholder')"
|
||||
/>
|
||||
</VField>
|
||||
<p v-if="errorKey" class="-mt-1 mb-3 text-xs text-danger">{{ t(errorKey) }}</p>
|
||||
<p v-if="errorKey" class="text-danger -mt-1 mb-3 text-xs">{{ t(errorKey) }}</p>
|
||||
<VBtn class="mt-1 w-full" variant="primary" type="submit" :disabled="submitting">
|
||||
{{ t("auth.loginAction") }}
|
||||
</VBtn>
|
||||
</form>
|
||||
<div class="mt-5 flex flex-wrap items-center gap-2 text-xs text-muted">
|
||||
<div class="text-muted mt-5 flex flex-wrap items-center gap-2 text-xs">
|
||||
<span>{{ t("auth.noAccount") }}</span>
|
||||
<NuxtLink class="text-primary hover:text-primary-hover" to="/register">{{ t("auth.registerNow") }}</NuxtLink>
|
||||
<NuxtLink class="text-primary hover:text-primary-hover" to="/forgot-password">{{ t("auth.forgotPassword") }}</NuxtLink>
|
||||
<NuxtLink class="text-primary hover:text-primary-hover" to="/register">{{
|
||||
t("auth.registerNow")
|
||||
}}</NuxtLink>
|
||||
<NuxtLink class="text-primary hover:text-primary-hover" to="/forgot-password">{{
|
||||
t("auth.forgotPassword")
|
||||
}}</NuxtLink>
|
||||
</div>
|
||||
</VCard>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user