
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
- Realtime didn't work in react native exp...
``` useEffect(() => { const { client } = createClient(); const unsubscribe = client.subscribe(`databases.${process.env.EXPO_PUBLIC_APPWRITE_DATABASE}.t...
- I had a new error pop up today when test...
I've been working on my app, it worked fine previously but now I recieve Invalid Origin: Register your new client as a new iOS platform on your project console ...
- CLI Error: Email and URL Field Types Not...
CLI throws "Unsupported attribute type: email" when pushing tables with `email` or `url` field types. Environment - CLI: appwrite-cli (npx) - Region: NYC Cloud...
