fix: redirect after register
All checks were successful
All checks were successful
This commit is contained in:
parent
bc7fddddcc
commit
22f1ce02d8
@ -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',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user