Convex Auth Missing SITE_URL in Expo App
The docs say that SITE_URL is not needed when I am using react native. For my expo app I am getting an error regarding missing env SITE_URL. Is there anything I am missing or is SITE_URL actually required?
9 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
Did you set the
redirecTo
param and redirect
callback like in https://labs.convex.dev/auth/config/oauth#add-sign-in-button ? Make sure to use the ReactNative selector.
here's the code that was throwing the error I believeOAuth - Convex Auth
Authentication library for your Convex backend
GitHub
convex-auth/src/server/implementation/redirects.ts at 1ed1f410ef3bf...
Library for built-in auth. Contribute to get-convex/convex-auth development by creating an account on GitHub.
I am using OTP with resend, does this method work with that or is it specific to OAuth?
I would configure the SITE_URL for your app's url, have you tried that? I haven't played with RN & auth much, but any time a user needs to get redirected to your app, I'd suspect you need to provide a URL
It works but for some reason also have to manually setup the private and public key as well or else it errors. I was under the impression that
npx @convex-dev/auth
sets that up for us.have you run that command? does it say it's setting the values or already has the values? You can see all your set environment variables with
npx convex env list
I think you're running into https://github.com/get-convex/convex-auth/issues/40 -- sounds like setting a dummy
SITE_URL
will probably unblock you (or setting it to the URL of your Expo app)
npx @convex-dev/auth
is supposed to set up JWKS
and JWT_PRIVATE_KEY
for you, so sounds surprising that you had to manually set them -- if you remember more details / have logs from your initial npx @convex-dev/auth
handy, feel free to share themGitHub
OTPs should not require SITE_URL · Issue #40 · get-convex/convex-au...
https://discord.com/channels/1019350475847499849/1263635045483155556 It's because we always generate the URL that includes the code param, even in the case of OTPs. This comes from the shape of...
okay I deleted the env variables and tried it again, seems like
JWKS
and JWT_PRIVATE_KEY
is set but only SITE_URL is not because its a react native app. I think the "React Native projects don't require a SITE_URL" is kind of misleading thou because it required one to work.
As for the issue, I think its https://github.com/get-convex/convex-auth/issues/40 , setting the SITE_URL fixes it 👍 .GitHub
OTPs should not require SITE_URL · Issue #40 · get-convex/convex-au...
https://discord.com/channels/1019350475847499849/1263635045483155556 It's because we always generate the URL that includes the code param, even in the case of OTPs. This comes from the shape of...