Sronds
Sronds3d ago

isLoading from useConvexAuth() always returns false

I need help debugging why my useConvexAuth() hook is returning false for isLoading whether or not the user is going through the sign in process. It is completely unresponsive even signing out or in, it will just remain false. This happens for both normal password/email sign in as well as OAuth sign in. The only time it is set to true is briefly on app launch. But once the user tries signing in it won't be responsive anymore isAuthenticated on the other hand is properly functioning as expected. I am using React Native and have wrapped my app with
<ConvexAuthProvider
client={convex}
storage={Platform.OS === 'ios' || Platform.OS === 'android' ? secureStorage : undefined}
>
...(rest of children)
</ConvexAuthProvider
<ConvexAuthProvider
client={convex}
storage={Platform.OS === 'ios' || Platform.OS === 'android' ? secureStorage : undefined}
>
...(rest of children)
</ConvexAuthProvider
It's worth noting this used to work properly but I probably introduced a bug but i have no idea how to debug this
2 Replies
Convex Bot
Convex Bot3d ago
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!
sshader
sshader20h ago
Hey so this is the useConvexAuth imported from convex/react? The isLoading should be true after you've completed signing in with your auth provider -- in this case it sounds like you're using Convex Auth, the @convex-dev/auth library, right? -- while the credentials from your auth provider get propagated to the your Convex functions. When signed in or signed out, isLoading is supposed to be false, as well as when in the middle of a sign in flow. It's just meant to be true immediately on loading the page (when sending any stored auth information to the backend) or immediately after finishing signing in. Can you say more about how you wanted to use isLoading?

Did you find this page helpful?