Skip to content
Snippets Groups Projects

#49 - connection - from 'username' to 'e-mail address'

Merged #49 - connection - from 'username' to 'e-mail address'
1 unresolved thread
Merged simon.mellerin requested to merge 49-email-no-username into main
1 unresolved thread
7 files
+ 20
19
Compare changes
  • Side-by-side
  • Inline
Files
7
@@ -2,11 +2,11 @@
@@ -2,11 +2,11 @@
<Form
<Form
class="flex flex-col gap-2"
class="flex flex-col gap-2"
:validation-schema="validationSchema"
:validation-schema="validationSchema"
@submit="emit('login', $event.username, $event.password)"
@submit="emit('login', $event.email, $event.password)"
>
>
<Field name="username" v-slot="{ field, errorMessage }">
<Field name="email" v-slot="{ field, errorMessage }">
<label for="username">{{ t('connection.username') }}</label>
<label for="email">{{ t('connection.emailAddress') }}</label>
<InputText id="username" v-bind="field" :invalid="!!errorMessage" />
<InputText id="email" v-bind="field" :invalid="!!errorMessage" />
<Message v-if="errorMessage" severity="error">{{ errorMessage }}</Message>
<Message v-if="errorMessage" severity="error">{{ errorMessage }}</Message>
</Field>
</Field>
<Field name="password" v-slot="{ value, errorMessage, handleChange }">
<Field name="password" v-slot="{ value, errorMessage, handleChange }">
@@ -40,14 +40,14 @@ import Message from 'primevue/message'
@@ -40,14 +40,14 @@ import Message from 'primevue/message'
import Password from 'primevue/password'
import Password from 'primevue/password'
const emit = defineEmits<{
const emit = defineEmits<{
login: [username: string, password: string]
login: [email: string, password: string]
}>()
}>()
const { t } = useI18n()
const { t } = useI18n()
const validationSchema = toTypedSchema(
const validationSchema = toTypedSchema(
yup.object({
yup.object({
username: yup.string().required().label(t('connection.username')),
email: yup.string().required().label(t('connection.emailAddress')),
password: yup.string().required().label(t('connection.password'))
password: yup.string().required().label(t('connection.password'))
})
})
)
)
Loading