From f53f19dc934b615c9318ccbe6094ff0f16aa4fdd Mon Sep 17 00:00:00 2001 From: Clement Date: Sat, 27 Apr 2024 18:59:52 +0200 Subject: [PATCH] add some log --- front/src/pages/account/login.astro | 4 +++- front/src/pages/account/register.astro | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/front/src/pages/account/login.astro b/front/src/pages/account/login.astro index 4561636..038e0f4 100644 --- a/front/src/pages/account/login.astro +++ b/front/src/pages/account/login.astro @@ -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 } }) --- diff --git a/front/src/pages/account/register.astro b/front/src/pages/account/register.astro index 51fe66a..b54a454 100644 --- a/front/src/pages/account/register.astro +++ b/front/src/pages/account/register.astro @@ -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); }