Are you able to see the network request details
this?
No the account.get() call
Is it the last session cookie that came from Appwrite?
it gets called on page load by the middleware. so can't specify it from the console
what do u mean by the last session cookie?
The last time you created the email session.
maybe i'm too noob to understand what u saying. do u want me to remove the middleware code and do a successful login, and then again add the middleware code and then compare the before and after cookie values?
Sure that could work.
Or you can manually try to use that cookie value to make the request
yoo... they aren't same😐
That's not good. Maybe the value in your middleware is an old deleted session and that's why you're getting the error
sad... how can i solve this?
Are you making sure to clear things as necessary?
clear things as necessary? didn't get it
For example, deleting the cookie if it's not valid anymore
i'm deleting the cookies only when the user logs out. do i need to do anything more?
Maybe it's not getting deleted in all places or something. I don't know. I hate nextjs
after some digging, i found that when the middleware is on, we are not setting any new cookie value. till now what i was seeing was the cookie from the last session
Again...I hate nextjs 🤣
and after your suggestion on another post of mine, i handled the cookies manually in the /auth/oauth2/success path
that means my middleware is redirecting it from /auth/oauth2/success to / before the code of /auth/oauth2/success gets executed
okay, so I just found out I'm nothing but dumb. i had to add /auth/oauth2/success as a public route in the middleware
don't hate nextjs. hate me🙂
[SOLVED] user session is created, but currentUser still returns null
Still hate nextjs because of all these gotchas 😜 I'm glad you figured it out <:appwriteparty:946072712915341333>
Recommended threads
- No server error on selfhosted appwrite
Please help me, my clients is ask what happen on their data? How can i make it up again?
- Upgrading selfhost version?
It is okay to upgrade version to higher one, of my current version is 1.7.4 to 1.8.1. Is that safe to do cause my clients already have data on that? Also is a...
- Streamlit UI and local DB
I want to use Appwrite for automation, like run watchdog service every morning 3 am. Anyone got suggestions, already explored github and documentation no luck. ...