
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
- Function gives unauthorized error when w...
I am on free tier. I have function that has three attributes: 1. A stand alone attribute (required) 2. A many to one relationship attribute 3. A many to man...
- Problem with login using Retool
I am using the Appwrite rest api to create an email session from Retool. My next api call is to create JWT. The call is failing because Retool is a closed envir...
- Appwrite sites 404
Hello ! When I add a subdomain to a deployed website, it gives me a 404 error on said domain thus making the SSL processus not working and im not able to acces...
