fix(api): 🐛 ctx.basePath maybe undefined and not suitable for redirect base url

This commit is contained in:
Julien Oculi 2024-06-20 14:45:14 +02:00
parent 79a6214f10
commit 3adc705e25

View file

@ -92,7 +92,7 @@ export const handler: SessionHandlers = {
ctx.state.session.set('user', user)
if (redirect) {
return Response.redirect(new URL(redirect, ctx.basePath))
return Response.redirect(new URL(redirect, ctx.url.origin))
}
return respondApi('success', user)