#Session not persist
7 messages · Page 1 of 1 (latest)
Hmm, I don't know enough to give you a confident answer yet. However, there could be several reasons why your Convex session is not persisting after redirecting from Discord Bot Auth.
One possibility could be that your backend isn't correctly configured. The auth.config.ts file in your convex/ directory contains a list of configured authentication providers. You must run npx convex dev or npx convex deploy after adding a new provider to sync the configuration to your backend. You can find more information about this in the Debugging Authentication (https://docs.convex.dev/auth/debug) guide.
Another possibility could be an issue with cookies stored in your browser. You could try clearing them and see if that resolves the issue.
If you're still having trouble, it would be helpful to provide more details about your issue. For example, are you seeing any error messages? What steps have you taken to try to resolve the issue?
You might also find it helpful to check the sync websocket and see whether the Authenticate message is being sent. You can find instructions on how to do this in the Debugging Authentication (https://docs.convex.dev/auth/debug) guide.
If you're still having trouble, I recommend reaching out to the Convex support team or the community on Discord for further assistance.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@pliant island kapa.ai is still learning and improving, please let us know how it did by reacting below
@polar adder I'm currently building an app and I need to connect my bot to users' Discord servers. I created a page where my users can connect my bot to their servers. I created a button which redirects to "https://discord.com/oauth2/authorize?client=..."
My users have to be logged in to access this page, so the user IS logged in at this time.
When they click on the button, they are redirected to the Discord auth page, and then I created a redirection to "http://localhost:3000". When the authentication is completed, my users are redirected to my app, but they are not logged in anymore... Their session is cleared and they are landed on my middleware redirection: "/signup".
Let me check the knowledge base for you. One moment! :books:
It seems like you're experiencing an issue where your users' sessions are not persisting after they are redirected back to your app from the Discord auth page. This could be due to a few reasons:
-
Backend Configuration: Ensure that your backend is correctly configured. The
auth.config.tsfile in yourconvex/directory contains a list of configured authentication providers. You must runnpx convex devornpx convex deployafter adding a new provider to sync the configuration to your backend. More details can be found in the Debugging Authentication (https://docs.convex.dev/auth/debug) guide. -
Session Storage: There could be an issue with the session storage in the browser. As mentioned in one of the Discord threads, a user reported that the
convex-session-idwas not consistently set in the Session storage, causing the session to disappear upon reloading the tab. It's worth checking if this is the case for your application. -
Cookies: There could be an issue with cookies stored in your browser. Try clearing them and see if that resolves the issue.
-
Websocket Authentication: Check the
syncwebsocket and see whether theAuthenticatemessage is being sent. Instructions on how to do this can be found in the Debugging Authentication (https://docs.convex.dev/auth/debug) guide.
If you're still having trouble, I recommend reaching out to the Convex support team or the community on Discord for further assistance.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@pliant island kapa.ai is still learning and improving, please let us know how it did by reacting below