Skip to content

Why is afterSignUpUrl or redirect not working? #3348

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: 3 comments 3 replies

Comment options

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

Answer selected by Aaryansh1
Comment options

You must be logged in to vote
2 replies
@Aaryansh1
Comment options

@crivera
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants