
when i'm using createEmailSession to create email login session, in response the token data is not coming with it { "$id": "64de39878196e89e0f5c", "$createdAt": "2023-08-17T15:15:19.539+00:00", "userId": "64dceedda788b04b4fd9", "expire": "2024-08-16T15:15:19.530+00:00", "provider": "email", "providerUid": "@gmail.comyemailm", "providerAccessToken": "", "providerAccessTokenExpiry": "", "providerRefreshToken": "", "ip": "172.19.0.1", "osCode": "WIN", "osName": "Windows", "osVersion": "10", "clientType": "browser", "clientCode": "CH", "clientName": "Chrome", "clientVersion": "115.0", "clientEngine": "Blink", "clientEngineVersion": "115.0.0.0", "deviceName": "desktop", "deviceBrand": "", "deviceModel": "", "countryCode": "--", "countryName": "Unknown", "current": true }

What token are you looking for?

"providerAccessToken": "",

This token is relevant only when you're using OAuth2

What you expect to be inside it

What is your use-case?

so i'm making a simple notes app with next js so i want my users to see only their own notes

For that you should use general Appwrite login logic.
After you've ran the createEmailSession
function then you can use account.get()
to get the user session, it will set the account cookies (or localstorage) and make any preceding requests will add the user automatically

Meaning, after you've run account.get()
and then you use the listDocuments
for example then only the document that user can see will returned.

also how can i map user to document like this note is created by this user how can i do that like is there any way to give foregin key thing to map user to that perticular document

To do that the best way would be to add an attribute named user_id
within it set the user ID

i was reading through docs about permissions, we can user permissions so if i create permission at the time of creation of document than i can do this

Yes

that way i can create team as well

Yes

Correct

okay i get it now
Recommended threads
- Sharing cookies
Hi, I’m using Appwrite Cloud, and I have a setup where my Appwrite backend is hosted on a subdomain (e.g., api.example.com), while my frontend (Next.js app) and...
- Organization not exists anymore
Hello! We have a problem with a cloud database. We are on the Free plan, but after a refresh the site wants me to create a new organisation, and I not see the c...
- JSON and Object Support in Collection do...
I am working with Next.Js and Appwrite Cloud, I am relatively New to Appwrite but i have noticed there is no direct support of JSON and Object support in attrib...
