callbackUrl to dynamic URL like sitename.com/@username not working. #7385
Unanswered
whoisanonymous
asked this question in
Help
Replies: 0 comments
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.
-
hey, so i'm trying to navigate the user after they signed in through Google using NextAuth to be redirected to their profile page which has their username in the URL.
Prior to this, i had the redirect set to /profile to make sure everything was set up correctly and it worked perfectly. but now that i want to make the callback URL dynamic with the users' username, but the user becomes undefined when using the code below on the client side on the Google button.
so i'm guessing this needs to be done in the callback section of /api/auth/[...nextauth].js? i just have no idea how to do it and i've read lots of NextAuth documentation and still getting lost.
i'm using prisma w/ a postgres db if that helps to know for anyone who knows what i need to do to send the user to sitename.com/@username after logging in from the provider screen.
Beta Was this translation helpful? Give feedback.
All reactions