Log out func is failing- acount.get() works in all other endpoints but here for some reason. I read the cookie, set the session and then delete the session doesnt work. Everything works until account.get() and deletesession(). Anyone know why?? how can it set a session that it can't delete in the same breath? error is : User (role: guests) missing scope (account)
Here is the api endpoint
async def logout( request: Request):
cookie= request.cookies.get('login')
print(cookie)
if not cookie :
raise HTTPException(status_code=401, detail="Already logged out")
try:
sessionclient.set_session(cookie)
account= Account(sessionclient)
print('session set')
account.get()
print('account gotten')
account.delete_session("current") ;
return { 'log out succesful'}```
Is it possible set_session() is failing?
And BTW, it’s best to format code by surrounding it by three backticks (```)
it doesnt fail, everything works until account.get()/deletesesssion()
maybe it should be done using admin client?* note- that didnt work either.
Recommended threads
- Student plan issue
I am using GitHub student plan, I even got access to appwrite's mock phone number. but when I try to use it, it says the phone number limit has reached
- Getting "The current user has been block...
So today I want to deploy something to Appwrite but when I click Sign in with Github, it's redirect me to login site and in the url bar I see this `?error=%7B"m...
- Flutter OAuth2 does not attach Google se...
Hi Appwrite team, I’m using Appwrite Auth in a Flutter mobile app and trying to upgrade an anonymous user to Google OAuth. Docs say that if there is already a...