Base solution for your next web application
Open Closed

Login from public page returns to public. #11142


User avatar
0
moonch created
  • What is your product version? MVC Core
  • What is your product type (Angular or MVC)?
  • What is product framework type (.net framework or .net core)? .net 6

Dear Customer support.

I have the following issue, 1- the user clicks the log in from the Public web site. 2- redirected to the account/login in the Admin web site. 3- Logs in and returns loged user to the Public website. !!! Please attached Image. 4- If he pressses the Back Button, he is re-directed to Tenant Dashboard which is the right page that should be after 2.

If the user Logs out. and relogs in, this will not happen agian, he is redirecrted correctly from the account/login page to the Tenant Dashboard. so the above only happens if the user trys to log in from the public website.

step-1

step-2

step-3

step-4

the following is the

1- In the Web MVC Project

appsetting.json appsetting.Production.json

"App": { "WebSiteRootAddress": "https://www.archflowsapp.com/", "RedirectAllowedExternalWebSites": "https://www.archflows.com/" }

2- In the Web Public Project

appsetting.json appsetting.Production.json

"App": { "WebSiteRootAddress": "https://www.archflows.com/", "AdminWebSiteRootAddress": "https://www.archflowsapp.com/" }

each domian points to azure app service in azure portal.


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @moonch

    This is actually by design. To change this behaviour, you can remove returnUrl parameter on the public page login button link.

  • User Avatar
    0
    moonch created

    So I need to Just to change the following in the Default.cshtml

    <a href="@(string.Format("{0}{1}?ss={2}&returnUrl={3}", Model.AdminWebSiteRootAddress, "account/login", "true", Model.WebSiteRootAddress + "Account/Login"))">@L("LogIn")</a>

    to

    <a href="@(string.Format("{0}{1}?ss={2}", Model.AdminWebSiteRootAddress, "account/login", "true")">@L("LogIn")</a>

    Is this Correct?

    Do i need to do anything in the Login view in the MVC web project!!!

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    No, you need to do it in the Public project. Here is the correct file Web.Public/Views/Shared/Components/Header/Default.cshtml. Just change this line

    <a href="@(string.Format("{0}{1}?ss={2}&returnUrl={3}", Model.AdminWebSiteRootAddress, "account/login", "true", Model.WebSiteRootAddress + "Account/Login"))">@L("LogIn")</a> 
    
    

    to this

    <a href="@(string.Format("{0}{1}?ss={2}", Model.AdminWebSiteRootAddress, "account/login", "true"))">@L("LogIn")</a>