Answer the question
In order to leave comments, you need to log in
How in ASP.NET Core Web API to implement a method for deleting a user by Id so that one user cannot delete another?
Hello! I want to implement a method to delete a user by Id. But after all, a user can enter the Id of another user and delete his account. How can you protect yourself from this? To allow the user to delete only their own account.
Answer the question
In order to leave comments, you need to log in
https://docs.microsoft.com/ru-ru/dotnet/api/micros...
To the delete controller.
Both of these methods are closed with this attribute
GET /api/account/delete issues a page
POST /api/account/delete deletes the user
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question