Open Closed

How to redirect to a certain page after login? #1074


User avatar
0
petri.uusitalo created
  • ABP Framework version: v4.2.1
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:

If I try to browse to a certain Angular page (e.g. /work-management/{id}) when I am not logged in I will be redirected to a login page as I have configured the AuthGuard. However after typing correct credentials it will not redirect to the page I originally visited (/work-management/{id}), but to the home page instead (localhost/4200).

How can I redirect to the correct page after login? The login page seems to the MVC page and not Angulare page as it is provided from different URL and port.


5 Answer(s)
  • User Avatar
    0
    alper created
    Support Team Director

    loginPage has a returnUrl parameter in MVC side. If you send a returnUrl parameter it should navigate to your URL

  • User Avatar
    0
    petri.uusitalo created

    loginPage has a returnUrl parameter in MVC side. If you send a returnUrl parameter it should navigate to your URL

    Not sure if I understood correctly. Do you mean that include 'returnUrl' parameter as query string in the URL or what do you mean by "send a returnUrl parameter?

    I tried to add it as a query string, but it doens't work -> it will always redirect to home page after login.

  • User Avatar
    0
    Mehmet created

    Hi,

    Please see this issue. It is the same problem.

  • User Avatar
    0
    petri.uusitalo created

    Hi,

    Please see this issue. It is the same problem.

    Thanks for the hint. This seems to be a workaround also in my case.

  • User Avatar
    0
    Mehmet created

    This seems to be a workaround also in my case.

    Yes. Unfortunately we can't do anything about that. Because the problem related to angular-oauth2-oidc package. I will let you know if we find a good solution

Made with ❤️ on ABP v9.1.0-preview. Updated on November 19, 2024, 12:56