I'm troubleshooting where HttpUnauthorizedResult is returned in code called within the shopping cart.
I see that when the shopping cart "Checkout" button from the OrderSummary.cshtml is clicked it calls the "startcheckout" from ShoppingCartController.cs
if (_workContext.CurrentCustomer.IsGuest()) { if (_orderSettings.AnonymousCheckoutAllowed) { return RedirectToRoute("LoginCheckoutAsGuest", new {returnUrl = Url.RouteUrl("ShoppingCart")}); } else { return new HttpUnauthorizedResult(); } }
If Annonymous checkout isn't allowed the system returns HttpUnauthorizedResult. Which I think should take me to the login page but, it doesn't. Instead I get the error page for "no Web page matching"
Where I get hung up is how the "view" HttpUnauthorizedResult becomes /Account/Login. For some reason /Account/Login cannot be found when it is called.
Searching through the controllers to try to find information, I can't find an "Account" controller. However, there is a "Login" controller but, I've noticed if I use the URL /Login works just fine.
How is HttpUnauthorizedResult returning Account/Login?
Thank you. I was wondering more how the /Account part of /Account/Login gets in there. "Account" is not in that file. If I can find where Account is being put into the URL, maybe I can determine whether or not having my site hosted in a subdirectory is the issue.