Hi,
I'm trying to add a new method to the AccountController in the API project but is not working, looks like the controller just allow one method, I created a different controller and is the same thing. If I rename the Authenticate method to anything else I am still can access the Authenticate method in postman, seems that is the default route and just allow one method. When I added a new method just throw an error but nothing is registered in the error log, can you help me, please. I don't know if I missing something. Thanks in advance
3 Answer(s)
-
0
I think probably you need to pass token to your method
-
0
Hi,
Can you share your controller's code ?
-
0
Hi, thank you for you response.
I just added a new dummy method in the api AccountController:
[Route("api/Account/Register")] [HttpPost] public AjaxResponse Register() { return new AjaxResponse(true); }
and just added the route in the Authenticate action:
[Route("api/Account/Authenticate")]
The Authenticate action is working, but the when I hit to Register action is calling the Authenticate action, even if I just call the api like this: <a class="postlink" href="http://localhost:6634/api/Account">http://localhost:6634/api/Account</a> is responding the Authenticate method
Those are the only changes I made. I don't know if I have to configurate something else.
Thanks in advance