So the problems stands like this, I have a top navbar which has a logout link like this
<ul class="navbar-nav ml-auto">
@if (signInManager.IsSignedIn(User))
{
<li class="nav-item">
<form method="post" asp-controller="account" asp-action="logout">
<button type="submit" style="width:auto"
class="nav-link btn btn-link py-0">
Logout @User.Identity.Name
</button>
</form>
</li>
}
else
{
<li class="nav-item">
<a class="nav-link" asp-controller="account" asp-action="register"> Register</a>
</li>
}
</ul>
My project also includes areas so I have 2 areas Broker/Customer :
After login with a broker the form action for logout will modify to this
action: /Broker/account/logout, this will cause a problem because i don't have that controller in my Broker area
The question: why it is not showing a /account/logout action like it is stated in my form "post" code: form method="post" asp-controller="account" asp-action="logout"
Account Controller is not defined in any area, it belongs to default Controllers folder as you can see on the image and that AccountController / Logout action will just redirect to HomeController / Index action.
Please help me understand :D
EDIT: MY ROUTING :
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{area:exists}/{controller=Account}/{action=Login}/{id?}");
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Account}/{action=Login}/{id?}");
endpoints.MapRazorPages();
});


