all repos — caroster @ 1b268e0d54e0d514668a3dc9cd017599b721ba55

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

fix: 🐛 Fix auth redirection
Tim Izzo tim@octree.ch
Mon, 03 Oct 2022 09:33:17 +0000
commit

1b268e0d54e0d514668a3dc9cd017599b721ba55

parent

39fd63e38e2eea8a7945a6ea37cca60f0a1896cc

3 files changed, 9 insertions(+), 6 deletions(-)

jump to
M backend/.gitignorebackend/.gitignore

@@ -113,4 +113,5 @@ *.cache

build .strapi-updater.json restart.test -dist/+dist/ +.strapi-updater.json
D backend/.strapi-updater.json

@@ -1,5 +0,0 @@

-{ - "latest": "4.3.9", - "lastUpdateCheck": 1664350479043, - "lastNotification": 1664357206868 -}
M frontend/pages/api/nauth/[...nextauth].jsfrontend/pages/api/nauth/[...nextauth].js

@@ -75,6 +75,13 @@ session.user.lang = token.lang;

} 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; + return baseUrl; + }, }, pages: { signIn: '/auth/login',