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
- Rate Limit of project
AppwriteException: Rate limit for the current endpoint has been exceeded. Please try again after some time. So , how much time I have to wait and why does it h...
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...
- Deep Linking & Password reset
I am using react native with expo. I want to implement deep link with the url recived via email. So when clicked the link it opens my app. I havent ever used de...