feat: implement user authentication, profile management, and email verification with i18n support

This commit is contained in:
supalerk-ar66 2026-02-03 11:01:33 +07:00
parent 06db182c46
commit b2365a4c6a
6 changed files with 271 additions and 17 deletions

View file

@ -7,12 +7,14 @@
const props = defineProps<{
modelValue: any; // userData (firstName, lastName, phone, etc.)
loading: boolean;
verifying?: boolean;
}>();
const emit = defineEmits<{
(e: 'update:modelValue', value: any): void;
(e: 'submit'): void;
(e: 'upload', file: File): void;
(e: 'verify'): void;
}>();
const { t } = useI18n();
@ -153,9 +155,28 @@ const handleFileUpload = (event: Event) => {
class="premium-q-input"
:rules="emailRules"
hide-bottom-space
disable
readonly
:hint="$t('profile.emailHint')"
/>
>
<template v-slot:append>
<div v-if="modelValue.emailVerifiedAt" class="flex items-center gap-1">
<q-icon name="check_circle" color="positive" />
<span class="text-green-600 text-xs font-bold">{{ $t('profile.emailVerified') || 'ยืนยันแล้ว' }}</span>
</div>
<q-btn
v-else
flat
dense
no-caps
color="negative"
icon="mark_email_read"
:label="$t('profile.verifyEmail') || 'ยืนยัน'"
class="text-sm font-bold"
:loading="verifying"
@click="$emit('verify')"
/>
</template>
</q-input>
</div>
<div>