SignIn callback returning a relative path fails #8025
Unanswered
nhuethmayr
asked this question in
Help
Replies: 1 comment 1 reply
-
@nhuethmayr did you ever fix this? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys,
I'm having the following piece of code in my project
As you can see, instead of returning a
relative
URL - I'm returning an absolute one.This is due to an error I get when doing otherwise.

From the browser

and here the source
next-auth/packages/next-auth/src/react/index.tsx
Line 277 in 1e886b9
The error above can be avoided by returning an absolute URL which then causes problems on Vercel because the environment variable NEXTAUTH_URL does not exist.
https://next-auth.js.org/configuration/callbacks#sign-in-callback
The documentation clearly states that I should be able to return a relative path so I'm wondering what I need to do for this to work properly. I'd most certainly prefer a solution that does not require me to do string-concat magic
Beta Was this translation helpful? Give feedback.
All reactions