This commit is contained in:
@@ -29,6 +29,22 @@
|
||||
|
||||
<!-- Password Setup Form -->
|
||||
<v-form ref="formRef" v-model="formValid" @submit.prevent="setupPassword">
|
||||
<!-- Email Input (shown when email is not provided in URL) -->
|
||||
<v-text-field
|
||||
v-if="showEmailInput"
|
||||
v-model="email"
|
||||
label="Email Address"
|
||||
variant="outlined"
|
||||
density="comfortable"
|
||||
:rules="emailRules"
|
||||
:error="!!errorMessage"
|
||||
prepend-inner-icon="mdi-email"
|
||||
class="mb-3"
|
||||
autocomplete="email"
|
||||
type="email"
|
||||
placeholder="Enter your email address"
|
||||
/>
|
||||
|
||||
<v-text-field
|
||||
v-model="password"
|
||||
:type="showPassword ? 'text' : 'password'"
|
||||
@@ -187,6 +203,7 @@ const confirmPassword = ref('');
|
||||
const route = useRoute();
|
||||
const email = ref((route.query.email as string) || '');
|
||||
const token = ref((route.query.token as string) || '');
|
||||
const showEmailInput = ref(!email.value); // Show email input if email is not provided
|
||||
|
||||
// Form ref
|
||||
const formRef = ref();
|
||||
@@ -235,6 +252,11 @@ const confirmPasswordRules = [
|
||||
(v: string) => v === password.value || 'Passwords do not match',
|
||||
];
|
||||
|
||||
const emailRules = [
|
||||
(v: string) => !!v || 'Email address is required',
|
||||
(v: string) => /.+@.+\..+/.test(v) || 'Please enter a valid email address',
|
||||
];
|
||||
|
||||
// Set page title with mobile viewport optimization
|
||||
useHead({
|
||||
title: 'Set Your Password - MonacoUSA Portal',
|
||||
|
||||
Reference in New Issue
Block a user