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
- Weird permission failure
when creating an account I use following methods: ``` Future<void> register(String email, String password, String username) async { final user = await accoun...
- Flutter Android oAuth is no more working
I currently don't get the oAuth login to work in flutter android. it works on ios and on web. but when try to use it on Android, i get to the point where the ca...
- I'm experiencing a critical bug on Appwr...
Hey <@870607367597850624> team / support š I'm experiencing a critical bug on Appwrite Cloud that's blocking my production Flutter app. I've already filed GitH...