AuthLoading
Hello, I'm using web3auth for user Authentication, and when someone who is unauthenticated tries to access the application, it takes them to the sign-in page, and from there, they go through sign in process, but lets say they cancel while going through the process, the app is stuck at the AuthLoading screen, not sure if there's a way to set timeout with AuthLoading or even better notice there's an error and goes back to the unauthenticated state.
this is my convex client provider

12 Replies
Hey @prinz, I think this is an issue with the Web3AuthProvider or your useAuthFromWeb3Auth hook, it presumably gets stuck in its loading state?
yeah i think so, thanks!
Also does convex allow access to the token_id when we set up ConvexcProviderWithAuth, in that it's possible to use convex to get the token for use in a middleware.ts
You can get the token from your auth provider directly. And depending on the auth provider, it might be in the headers / cookies and accessible by Next.js middleware. But that is entirely up to the auth libraries. Convex isn't in the loop for Next.js middleware, if I understand correctly
yes, I believe so as well, thanks for clarifying!
quick question, what is the auth.config.js file for?
See one of our authentication guides: https://docs.convex.dev/auth/clerk
Convex Clerk | Convex Developer Hub
Clerk is an authentication platform providing login via
got it, thanks!
the reason I was asking was because I wanted to use the Authenticated and Unauthenticated Components and I figured configuring the auth.config.js would help with that, which it does according to the docs. However, after setting that up and configuring the ConvexProviderWithAuth along with the ConvexProviderWithProviderX.js file, I still don't have access to those components

that is my ConvexProviderWithProviderX.js file
What do you see in your browser console after you log in?
You can also add
verbose: true
to new ConvexReactClient
to get more information.nothing really, the console logging of the token, isAuthenticated and isLoading console.log'ed in page is showing, but for some reason, the same variables are not linking so as to use those components

updated ConvexProviderWithProviderX.js file

@prinz that browser console.log doesn't show any messages from the ConvexClient besides the websocket reconnected. Are there more messages above? Can you check the
sync
websocket messages in network tab and see whether there's an "Authenticate" message?