Waffleophagus
CCConvex Community
•Created by Waffleophagus on 5/1/2025 in #support-community
Logging into new user "doesn't work" on react native since I store state?
As mentioned in #"Upgrading" Anonymous accounts to "real" accounts with email I start all users out with an anonomyous account then letting them auth into a real account. I am trying to store some of that in a local store since its react native and my goal is to give an offline experience for my users, but the thing I've been banging my head against for the past like 3 evenings (yay off time projects) is that when a user auths with an email, it doesn't take effect immediately, and I end up having to exit and come back to the app, doing that solves it perfectly. Is it a race condition? What is the simplest way to handle this? I'll happily share anything I have to get this working.
27 replies
CCConvex Community
•Created by Waffleophagus on 4/27/2025 in #support-community
"Upgrading" Anonymous accounts to "real" accounts with email
Out of the gate when you log in to my react native application, I give you an anonymous account. My goal is to push the user into signing up and at that point we "upgrade" the account from an anon to a "proper" account. I know that this will require some custom account linking outlined briefly here: https://labs.convex.dev/auth/advanced#account-linking But from where I'm sitting I'm trying to nail down the best pattern that makes it such that the user does not lose any data. The goal being give them access to the app with as little barrier as possible and make them want to sign up. The thing that is a sticking point is right now I'm using Resend OTP codes, and I don't see a clean way to just give the built in Resend/Email functionality an existing userID, and the built in flow generates a new UserID when the flow begins.
Is there a way to better call these internal things or should I just kinda... re-implement the OTP functionality? Will I have to do the same with the OAuth providers when I get to that? (Was planning on adding them in addition to OTP when the app is closer to production) Is there an example somewhere of this upgrade path? I'll happily share anything I have so far.
24 replies