feat: gestion-utilisateur #1

Merged
Clement merged 37 commits from feat/gestion-utilisateur into master 2024-05-20 10:48:35 +00:00
2 changed files with 4 additions and 2 deletions
Showing only changes of commit f53f19dc93 - Show all commits

View File

@ -21,10 +21,12 @@ const res = await AstroUtils.wrap(async () => {
}
try {
pb.collection('users').authWithPassword(request.user,request.password);
await pb.collection('users').authWithPassword(request.user,request.password);
return Astro.redirect("/account")
} catch (error) {
console.log(error)
console.warn('user password is incorrect')
return Astro.redirect("/account/login");// route('/account/login', {message: 'Compte invalide, valider les identifiants'})) //XXX: comprendre comment le system de route fonctionne
}
})
---

View File

@ -24,7 +24,7 @@ await AstroUtils.wrap(async () => {
}
try{
await pb.collection('users').create(request)
return Astro.redirect('account/login')
return Astro.redirect('/account/login')
}catch(e){
console.log(e);
}