all repos — caroster @ e8ac86df85718ab0870d106bbec4bf9eda68347c

[Octree] Group carpool to your event https://caroster.io

🔒️ Fix redirection on login
Tim Izzo tim@octree.ch
Tue, 25 Oct 2022 17:31:26 +0200
commit

e8ac86df85718ab0870d106bbec4bf9eda68347c

parent

78ecb0cb7a059f82b469e466269e08d9f1244514

1 files changed, 2 insertions(+), 4 deletions(-)

jump to
M frontend/pages/api/nauth/[...nextauth].jsfrontend/pages/api/nauth/[...nextauth].js

@@ -80,12 +80,10 @@ }

return session; }, async redirect({url, baseUrl}) { - // Allows relative callback URLs if (url.startsWith('/')) return `${baseUrl}${url}`; - // Allows callback URLs on the same host else if (new URL(url).host === new URL(baseUrl).host) - return `${url}/dashboard`; - return baseUrl; + return `${baseUrl}/dashboard`; + else return baseUrl; }, }, pages: {