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