Hello, whenever i want to create document from flutter i get user_unauthorized here are the steps i did
1 Register new user :
TypeScript
userId: ID.unique(),
email: email,
password: password,
name: name,
);```
2 login :
```await account.createEmailPasswordSession(
email: email,
password: password,
);```
3 creating the document :
```await databases.createDocument(
databaseId: databaseId,
collectionId: collectionId,
documentId: ID.unique(),
data: data,
);```
Note: I selfhosted my instance
what im i doing wrong thanks ,
TL;DR
Issue: Getting 'user_unauthorized' error while trying to create a document from Flutter.
Solution: Ensure the user's session is active by calling 'account.get' before creating the document. This might require re-authenticating the user to generate a new valid session.
Steps taken:
1. Registered a new user using `account.create()`.
2. Logged in with the new user using `account.createEmailPasswordSession()`.
3. Attempted to create a document using `databases.createDocument()`, resulting in the error.
Note: Since you are self-hosting the instance, verify that the authentication process is correctly implemented tocan you make sure that current user's session is still active by calling account.get before calling create document ?
Recommended threads
- [SOLVED] curl error Number: 6 — function...
Hello, I invested a lot of time in this error in a fresh install of appwrite 1.8.1 and lasted until fix, this if for helping anyone that can have the same weird...
- android platform invaild origina
It happened today suddenly. Our app says invalid origin. And appwrite cloud says every time we tried to add the app to it: "param platformId" is not optional.
- Team invite - 500 error - no email
When executing ```dart await _repository.teams.createMembership( teamId: event.listId, roles: ['member'], email: event.email, url: 'xxxx', ); ``` I se...