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
- general_route_not_found - Auth Guide
If you’ve just added a subdomain to your project, verified your DNS records, and confirmed your SSL certificate is working, but you're still hitting a `general_...
- Impossible to get USER after createEmail...
Am using provider to deal with functions linked to appwrite. Here is my login. Future<String?> login(String email, String password) async { try { aw...
- User ID case sensitivity
I see that through REST (and SDK as well), getting a user is not case sensitive. And even though documentation does not clearly state that it is, the wording "V...