Hello 🙂 When I am trying to create a user document in my user database during registration (any can create) it successfuly creates the document but according to the console it fails during
const newDocument = await databases.createDocument(databaseId, collectionId, documentId, data);
with a Error 500 and then throws an error
at Client.<anonymous> (```
Logs state:
```Method: GET
2024-04-29T15:33:23.653360420Z [Error] URL: /v1/account
2024-04-29T15:33:23.653365730Z [Error] Type: Appwrite\Extend\Exception
2024-04-29T15:33:23.653371320Z [Error] Message: User (role: guests) missing scope (account)
2024-04-29T15:33:23.653376472Z [Error] File: /usr/src/code/app/controllers/shared/api.php
2024-04-29T15:33:23.653380947Z [Error] Line: 273```
Is this error due to creating a document without an active session? Can this be safely ignored or is there anyway around this/best practice how to store newAccounts in the Database?
Make sure to use three backticks ` to format code blocks to make it easier to read
The logs usually mean you aren't signed in
ahhh gotcha, thanks I fixed it 🙂
yeah, makes sense, but is there anything to get rid of them/another way to handle this? I am quite new to this, really appreciate your help Evan 🙂
- make sure the permissions are correct, any for create, update, reqd, delete. this isn't secure though. fine for testing.
- log the user in, if the permissions only allow performing crud ops. for users, guests, etc.
- I only applied Create for any, not update, read, delete - just creating should be fine, is like a signup no? Or still a safety issue?
- Issue I am having is, I do not know how else to do it. User Data needs to be stored in the user Database. All the tutorials I found online usually create the User in the DB during the registration and store it in the DB. It makes sense to me because this way Auth Database and User Database are always synchronous. THe only alternative I can think of is checking on login if the user exists in the database and creating it if not, but that also seems quite inefficient no?
Because I want to manually confirm the users in the backend and users are not allowed to login while they are not verified...
Recommended threads
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Send Email Verification With REST
I am using REST to create a user on the server side after receiving form data from the client. After the account is successfully created i wanted to send the v...
- Use different email hosts for different ...
Hello, I have 2 projects and i want to be able to set up email templates in the projects. Both projects will have different email host configurations. I see ...