Skip to content

Why is afterSignUpUrl or redirect not working? #3348

Answered by CBF2006
Aaryansh1 asked this question in Questions
Discussion options

You must be logged in to vote

Yeah I don't know exactly what happened to these commands (were used fine in a tutorial 2 months ago that I'm watching) but I found a fix from Stack Overflow

Put these two in your .env.local or .env depending on which you used:

NEXT_PUBLIC_CLERK_SIGN_IN_FORCE_REDIRECT_URL="/URL HERE"
NEXT_PUBLIC_CLERK_SIGN_UP_FORCE_REDIRECT_URL="/URL HERE"

Just replace URL HERE with whatever url you'd like
Don't do it in whatever .tsx file you put the login button in.

For sign out, I just did this in the .tsx file directly

<UserButton afterSignOutUrl="/" />

Hope this helps!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Aaryansh1
Comment options

Answer selected by Aaryansh1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants