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.

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • 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.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Mehmet created

    Hi,

    Please see this issue. It is the same problem.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • 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.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • 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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on October 05, 2026, 11:32
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.