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
- custom domain with CloudFlare
Hi all, it seems that CloudFlare has blocked cross-domain CNAME link which made my app hostname which is in CloudFlare, unable to create a CNAME pointing to clo...
- Custom emails
What happen if I use a third party email provider to customize my emails and my plan run out of emails/month? Appwrite emails are used as fallback sending emai...
- SyntaxError: Unexpected end of JSON inpu...
I am trying to create a fcm push notification service using appwrite functions with its REST API to invoke that function from my client side app and getting thi...