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
- custom domain with CloudFlare
Hi all, it seems that CloudFlare has blocked cross-domain CNAME link which made my app hostname which is in CloudFlare, unable to create a CNAME pointing to clo...
- Custom emails
What happen if I use a third party email provider to customize my emails and my plan run out of emails/month? Appwrite emails are used as fallback sending emai...
- SyntaxError: Unexpected end of JSON inpu...
I am trying to create a fcm push notification service using appwrite functions with its REST API to invoke that function from my client side app and getting thi...