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
- Why does this happen?
`AppwriteException: general_argument_invalid, Invalid `secret` param: Value must be a valid string and at least 1 chars and no longer than 256 chars (400)` the...
- Selfhosted starter python function retur...
I am running a selfhosted appwrite instance. Creating a node function and executing it works just fine but when i try to execute a python starter function, i ge...
- Can't run functions from console in appw...
Hello, I have an appwrite 1.9.0 self hosted, functions run correctly with client SDK or event when using the function domain *.function.mydomain, for testing pu...