🐛 fixing profile data and some QA issues

This commit is contained in:
ChatonDeAru
2024-09-26 16:14:57 +02:00
parent 622841eed3
commit 4bc3a58b3e
18 changed files with 121 additions and 61 deletions

View File

@@ -14,7 +14,7 @@ const links = computed(() => {
if (!user.value) {
tmp.push({
label: 'Rejoindre FO',
label: 'S\'inscrire sur FO',
to: '/join'
})
} else {
@@ -31,6 +31,8 @@ const signOut = async () => {
const { error } = await auth.signOut()
if (error) console.log(error)
router.push('/')
// TOFIX
}
</script>

View File

@@ -2,6 +2,7 @@
import { object, string, type InferType } from 'yup'
import type { Database } from '@pel/supabase/types'
import type { FormSubmitEvent } from '#ui/types'
import { lowerString } from '~/utils/commons';
definePageMeta({
name: 'EmailUpdateForm',
@@ -15,7 +16,7 @@ const { inputStyle, formGroupStyle } = useFoStyle()
const loading = ref(false)
const schema = object({
email: string().lowercase().trim().email('Il semble que l\'email ne soit pas bon').required('Champ obligatoire'),
email: string().lowercase().trim().email('Il semble que l\'email ne soit pas bon').max(500, 'hmmmm c\'est un peu beaucoup là non ?').required('Champ obligatoire'),
})
type Schema = InferType<typeof schema>
@@ -29,7 +30,7 @@ async function onSave(event: FormSubmitEvent<Schema>) {
const formSubmit = event.data
const { data, error } = await auth.updateUser({
email: formSubmit.email,
email: lowerString(formSubmit.email),
})
if (error) {

View File

@@ -17,7 +17,7 @@ const { inputStyle, formGroupStyle } = useFoStyle()
const loading = ref(false)
const schema = object({
password: string().min(6, 'Il faudrait un minimum de 6 charactères').test({
password: string().min(6, 'Il faudrait un minimum de 6 charactères').max(500, 'hmmmm c\'est un peu beaucoup là non ?').test({
name: 'password',
message: 'Le mot de passe n\'est pas assez fort ~~',
test: (value) => {