how do i redirect a user after signing up or signing in to the current page
i am using clerk to handle authentication in my convex React app. whenever a user signs up or signs in they are redirected to the home page but i want the user to be sent back to the page they were on previously before signing up. I am using the clerk modals to handle this sign up and sign up. How do i go about this?
Thanks
12 Replies
You need to configure Middleware I guess
Or config files in convex
But not sure bout that
@NerdkidChiki See https://clerk.com/docs/references/javascript/types/redirect-options#redirect-options
RedirectOptions | Clerk
An interface that provides options for a range of redirect methods.
Thanks so much for the reply 🙏. I have read the documentation, but i wanna know how i would set that url if i use a modal for signing in and signing out. The user can sign in or sign up on a lotta pages using the pop up modal.How do i set the url to be dynamic depending on the users url
you would set the page they are on as a variable that is passed to clerk
I am using clerks custom button fro sign in, sign up and sign out, how do i go about this?....cuz i believe i have to set this on my clerk project dashboard
SignInButton | Clerk
The SignInButton component is a button that links to the sign-in page or displays the sign-in modal.
this right?
SignUp | Clerk
The SignUp component renders a UI for signing up users.
@NerdkidChiki Check out this GPT prompt for an example
also not sure if clerk will append your domain settings to the redirectUrl, but if not you'll need to pass an absolute path to them, ie.
thanks so much...you have been helpful