Admin
Same reason why account.get() would fail. There needs to be a session
Votes
0
Replies
24
Participants
Unknown
Messages
25
Admin
Same reason why account.get() would fail. There needs to be a session
Rank 1: Thread
user CreateEmailSession() I was able to create a session id
Rank 1: Thread
I have stored this session id and stored it in browser session storage
Rank 1: Thread
now when I need to logout I am just trying to delete the session so that I am logged out, i am following correctly
Rank 1: Thread
Still didnt understood
Rank 1: Thread
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
Admin
The session isn't just an ID. Is your tech stack?
Rank 1: Thread
Sorry didnt get you
Admin
What are you using to build your app? React? NextJS? Nodejs?
Rank 1: Thread
Ahh, Astro js
Rank 1: Thread
checking what you mentioned in an earlier message if I am getting same error when I am trying to access account.get()
Rank 1: Thread
Yeah I get the same error as below on access account.get()
Rank 1: Thread
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' }}```Rank 1: Thread
I am using SSR with Astrojs on a node js server
Admin
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
Rank 1: Thread
No, No I am not creating the session server side, I am creating it on the client side
Admin
I always recommend avoiding SSR when possible
Rank 1: Thread
Astro is little different interms of SSR
Rank 1: Thread
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.
Rank 1: Thread
This seems to be some bug as I saw some other support tickets getting raised with the same error message.
Admin
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
Rank 1: Thread
but not 100% sure on this .
Admin
Rank 1: Thread
oh is it, and this values gets stored in the cookie by the client sdk itself ?
Admin
Browser automatically handles cookies