Open Closed

Failed to redirect user to a old URL after successful login #7014


User avatar
0
sridhar created

ABP Framework version: v7.2.2

UI Type: Angular

Database System: EF Core (SQL Server)

Tiered (for MVC) or Auth Server Separated (for Angular): yes

Exception message and full stack trace:

Steps to reproduce the issue:

We are using ABP with Angular , I have a situation in which on click of any link I want the user to be directed to login and after successful login we have to redirect the user to the same page that whatever user clicked before.

I tried this, const params = { returnUrl: 'https://www.google.ca/' }; this.authService.navigateToLogin(params);

I also tried it with my own Auth guard (canActivate) but they dont seem to be redirecting to the old url before logging in.

Please let me know what is the alternative to make this work(in Angular).

User Presses a Link => Redirect to Login Page => User again redirected to the link in step 1.


6 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    You need to add the https://www.google.ca to the RedirectAllowedUrls

  • User Avatar
    0
    sridhar created

    Ok I just put https://google.ca just as an example , actually I need to book keep the original url and redirect to this Url after successfully logged in, the issue is not about CORS ,

    Issue is its not able to redirect to the original url after logging in. inspite of following the ABP way of mentioning redirectUrl. It would be great if you could guide me in those directions

    I referred to these ABP link's but none of them are helping me https://github.com/abpframework/abp/issues/16588 https://support.abp.io/QA/Questions/5051/How-can-I-redirect-the-user-to-the-previous-URL-after-login

  • User Avatar
    0
    sridhar created

    Ok I just put https://google.ca just as an example , actually I need to book keep the original url and redirect to this Url after successfully logged in, the issue is not about CORS ,

    Issue is its not able to redirect to the original url after logging in. inspite of following the ABP way of mentioning redirectUrl. It would be great if you could guide me in those directions

    I referred to these ABP link's but none of them are helping me https://github.com/abpframework/abp/issues/16588 https://support.abp.io/QA/Questions/5051/How-can-I-redirect-the-user-to-the-previous-URL-after-login

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    It is included in 7.3, you need to upgrade your version

  • User Avatar
    0
    sridhar created

    Sorry I have a situation where I wont be able to upgrade now. Could you suggest me an alternative in 7.2.2

  • User Avatar
    0
    masum.ulu created
    Support Team Angular Developer

    Hi again sridhar, sorry for late reply. I'll check for a workaround and to inform you.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11