add astro template for front #13

Merged
Clement merged 18 commits from feat/astro-template-for-front into master 2024-05-21 08:07:58 +00:00
Showing only changes of commit 22f1ce02d8 - Show all commits

View File

@ -12,6 +12,8 @@ if(pb.authStore.isValid){
return Astro.redirect("/account") return Astro.redirect("/account")
} }
let loged = false
await AstroUtils.wrap(async () => { await AstroUtils.wrap(async () => {
if (Astro.request.method !== 'POST'){ if (Astro.request.method !== 'POST'){
return return
@ -26,11 +28,14 @@ await AstroUtils.wrap(async () => {
} }
try{ try{
await pb.collection('users').create(request) await pb.collection('users').create(request)
return Astro.redirect('/account/login') loged = true
}catch(e){ }catch(e){
console.log(e); console.log(e);
} }
}) })
if (loged) {
return Astro.redirect('/account/login')
}
const metadata = { const metadata = {
title: 'Register', title: 'Register',