So, here's the code
TypeScript
try {
const name = email.split("@")[0];
const userID = ID.unique();
await account.create({
userId: userID,
email,
password,
name,
});
await tablesDB.createRow({
databaseId: DATABASE_ID,
tableId: "users",
rowId: userID,
data: {
name,
email,
}
});
} catch (error: unknown) {
console.log(error);
if (typeof error === "object" && error) {
throw (error as AppwriteException).message;
} else throw error;
}```
Here, on adding row to table, I am getting error `[AppwriteException: The current user is not authorized to perform the requested action.]` even though, on dashboard, the data is being added successfully
My permissions for `users` table is (pfa)
I'm not sure how to fix this
TL;DR
Code is successfully adding data to the database but encountering a permission error. Check the permission settings for the `users` table in the dashboard. Make sure the current user has the necessary permissions to write to the table. If the data is being added successfully, it might be a casing issue or you're looking at the wrong database.Recommended threads
- Local Serverless Function Testing: Are D...
I have followed the instructions to get the CLI working, and have been able to log-in, initialize my project, and created a simple Python function, which calls ...
- Update user email using OTP
Hi, I am trying to implement email update using OTP, there is not password associated with the account. One solution I found online is creating appwrite functio...
- Magic Link token automatically consumed
Hi, I'm using the Magic Link auth system with Appwrite Cloud and I'm running into huge issues getting users to log in successfully. About 9 times out of 10, th...