🔒️ Fix redirection on login
Tim Izzo tim@octree.ch
Tue, 25 Oct 2022 17:31:26 +0200
1 files changed,
2 insertions(+),
4 deletions(-)
M
frontend/pages/api/nauth/[...nextauth].js
→
frontend/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: {