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
- getting 429 rate limit on my appwrite de...
how to fix this issue ?
- type generation on same columns in table
is there way to prevent this ? or only need to update column name like table prefix?
- Unable to send verification email
Hi! I’m trying to access my project on Appwrite Cloud (fra.cloud.appwrite.io), but I keep getting this popup saying: “To continue using Appwrite Cloud, please...