omar abdouOriginal post
Web Developer
Hello, whenever i want to create document from flutter i get user_unauthorized here are the steps i did
1 Register new user :
Plain text
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 ,Summary
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 to