I am implementing an account deletion feature to allow users to delete their own account.
I have made sure to delete the associated data from the user (i.e. user profile data which is on a collection). The user is logged in and has an active session.
When requesting the userDelete process, I get a permissions error:
"message": "[user's email address] (role: users) missing scope (users.write)"
How can I update user permissions to make sure users are able to delete their own account?
I have a user_profile collection, and from my appwrite.json file I have the following permissions on it: "$permissions": ["create(\"users\")", "read(\"guests\")", "update(\"users\")", "write(\"users\")"],
I don't think this is related to the user/auth permissions though. Is there a way to set user/auth permissions to users ?
This is the GraphQL query I am running:
const authUserDeleteResponse = await graphql.mutation({
query: `
mutation DeleteAuthUser(
$userId: String!
) {
usersDelete(userId: $userId) {
status
}
}
`,
variables: {
userId
}
});
Recommended threads
- Authentication on custom Websocket Serve...
Hi, I want to use a custom Websocket Server (using Bun) for my application. However I cant really figure out authentication on custom servers. Session cookies ...
- Realtime: Listener not triggered on upda...
I self host appwrite 1.8.1. The genereal functionallity works fine. But my realtime subscription isn't updating. I see "Received heartbeat response from realtim...
- My account got banned without obvious re...
Hello, I’m a normal user of Appwrite. Today I found my account was banned suddenly, and I can’t log in normally. I have only been doing normal development and...