In my scenario, I have provided router path under namespace of the controller. Also, by having View() method in the same controller. remove the View() method if it is an API project. It will help to resolve the issue.
namespace [project_name]{
[Route("api/[controller]")]
[ApiController]
public class AuthController : Controller
{
public IActionResult Index()
{
return View();
}
public IActionResult Authenticate(string password, string email)
{
// code here
}
}
}