Hello I've been wondering if it's possible to delete a user from the Auth menu. I was able to write a cloud function that gets the uid and runs Users.delete(uid) doesn't delete the user in the Auth tab of the appwrite console. Would love to hear from other people more experienced
What was the results of the Users.delete function?
It says "user role: guests" "account required"
Can you share the code of the function?
I'm calling the function wrong I think. I'm using a http POST
Sure
That's the function I'm using dart for it
And here is how I'm sending the uid to it
What did you put inside the deleteUserFunctionId variable?
The payload I was trying to send
I'm probably doing this all wrong and there's a simple way of passing the uid to the function
This code is inside the App in your flutter project?
The first one is a function folder I deployed and the second one inside my flutter app lib folder both are in my flutter project
Okay, good
Awesome
Not sure if the second one is right but I think the first one is since I followed the documentation for it
I just tried sending the uid string using http as a payload and I think that's the problem
Not sure how other appwriters send uids and other stuff to functions
So you'll need to change a few things.
First you can if you want to use Appwrite flutter package (https://appwrite.io/docs/getting-started-for-flutter)
API Key The API key let's you access Appwrite resource on a server level https://appwrite.io/docs/sdks#server That's means that unless you have a very good reason for that you only use this key in server side code as your function.
Flutter
So, In your flutter code (App) when execution a function you should remove the X-Appwrite-key header.
Function
In your function I think that you'll need to to change the line 34 in which you're using the deleteUserFunctionId constant to delete_user_API one
Is this make sense?
Yup makes sense didn't know the header part and I think you're right about changing the deleteUserFunctionId to delete_user_API
Going to try them out now
It can be confusing at start
Recommended threads
- Go 1.25 runtime
So I'm trying to use go 1.25 for my functions and I can only find go-1.23 as a function runtime. So I did some searching and found https://github.com/appwrite/a...
- Help
- Python TablesDB Rework
Hi, i starting to rework some older functions to TablesDB list_rows Method. I used list_documents with a resultset with worked fine. Now i tried to get all rows...