erquhart
erquhart•6mo ago

Convex Auth OTP requires redirect url or SITE_URL

When attempting to use the OTP method alone, SITE_URL is required (unless you provide a redirect url). This line in particular leads to a thrown error: https://github.com/get-convex/convex-auth/blob/90318a4d346523035ed9c75e70cd99653a5bede9/src/server/implementation.ts#L1744 I'm not yet processing links inbound to my react native app, so I don't want to use magic links and don't have a redirect url or site url to use, hence my interest in OTP-only.
7 Replies
erquhart
erquhartOP•6mo ago
For now I've set a dummy SITE_URL, so not blocked. (And I have Convex Auth up and running in place of Clerk in React Native 🎉 )
Michal Srb
Michal Srb•6mo ago
Yeah, good catch. Unfortunate result of reusing the email provider type for both magic links and OTPs.
Michal Srb
Michal Srb•6mo ago
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...
erquhart
erquhartOP•6mo ago
Ah, that makes sense
Yur Boi Danny
Yur Boi Danny•4mo ago
Hi @erquhart, may I ask where did you set the SITE_URL to work around this issue?
erquhart
erquhartOP•4mo ago
It's an environment variable, set it in the Convex dashboard
Yur Boi Danny
Yur Boi Danny•4mo ago
Thanks!