
Same reason why account.get()
would fail. There needs to be a session

user CreateEmailSession() I was able to create a session id

I have stored this session id and stored it in browser session storage

now when I need to logout I am just trying to delete the session so that I am logged out, i am following correctly

Still didnt understood

I thought, create account, then create email session is enough to login and authenticate, can you point me to any documentation explaining how this works

The session isn't just an ID. Is your tech stack?

Sorry didnt get you

What are you using to build your app? React? NextJS? Nodejs?

Ahh, Astro js

checking what you mentioned in an earlier message if I am getting same error when I am trying to access account.get()

Yeah I get the same error as below on access account.get()

at Client.<anonymous> (file:///Users/tejas.shah/Projects/thehigglers/thehigglers/node_modules/appwrite/dist/esm/sdk.js:385:27)
at Generator.next (<anonymous>)
at fulfilled (file:///Users/tejas.shah/Projects/thehigglers/thehigglers/node_modules/appwrite/dist/esm/sdk.js:22:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: 401,
type: 'general_unauthorized_scope',
response: {
message: 'User (role: guests) missing scope (account)',
code: 401,
type: 'general_unauthorized_scope',
version: '0.10.10'
}
}```

I am using SSR with Astrojs on a node js server

Ya that's the big problem. You might be creating the session server side which doesn't persist. If you're making the session client side, it won't automatically be used server side

No, No I am not creating the session server side, I am creating it on the client side

I always recommend avoiding SSR when possible

Astro is little different interms of SSR

I agree over the last office hours this was discussed but with astro we will have to use SSR if authentication needs to be setup, secondly I tried creating the session on client side using vanila js as well, I store the response in session storage still I am unable to delete the created session on the Appwrite.

This seems to be some bug as I saw some other support tickets getting raised with the same error message.

As I mentioned the result of the API call is just data. It's not the actual session. The session is stored in a cookie or the x-fallback-cookies header

but not 100% sure on this .


oh is it, and this values gets stored in the cookie by the client sdk itself ?

Browser automatically handles cookies
Recommended threads
- "The document data is missing. Try again...
Hello, I am getting this error suddenly. I have been using this service for a year now, and I haven't made any changes to my code since then. My app was workin...
- Error: The document data is missing. Try...
I am not able to create any document on some of the collection/ DBs. As I can see many of us facing the same issue, need a quick resolution from the Appwrite Te...
- Appwrite Error: 401 Unauthorized on getC...
Hi everyone, I'm getting an error while trying to fetch the current user using Appwrite in my React project. Here's the error log: auth.js:41 GET https://fra....
