cyremur
cyremur4mo ago

```http://localhost:3000/?code=

http://localhost:3000/?code=96547846
http://localhost:3000/?code=96547846
Is this supposed to happen after the discord login wiht convex-auth?
3 Replies
cyremur
cyremurOP4mo ago
it looks like this happens in the starter template as well but then is redirected to just localhost super fast... is there some kind of handling I need to configure?
sshader
sshader4mo ago
You might need a custom replaceURL (https://labs.convex.dev/auth/api_reference/react#convexauthprovider) depending on your frontend framework. Convex Auth attempts to clean up the code param for you here but might need a custom replaceURL
react - Convex Auth
Authentication library for your Convex backend
GitHub
convex-auth/src/react/client.tsx at 54f0992e6c75fe5679f28e4e76c935a...
Library for built-in auth. Contribute to get-convex/convex-auth development by creating an account on GitHub.
cyremur
cyremurOP4mo ago
Thanks for the hint, I assumed this need to be happening somewhere but couldn't find the place. Will invest in gate further. So replaceUrl is given to the Auth context provider on root and should probably something like next router redirect, right? Will look into how the next example is scaffolded so I can understand the connective tissue there.
import { useRouter } from "next/router";

const router = useRouter();

<ConvexAuthProvider
client={convex}
replaceURL={(relativeUrl) => void router.replace(relativeUrl)}
>
import { useRouter } from "next/router";

const router = useRouter();

<ConvexAuthProvider
client={convex}
replaceURL={(relativeUrl) => void router.replace(relativeUrl)}
>
@sshader thanks this worked

Did you find this page helpful?