Open Closed

"remember me" feature still not working properly in Angular #7714


User avatar
0
ademaygun created
  • ABP Framework version: v8.1.1
  • UI Type: Angular
  • Database System: EF Core
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace:
  • Steps to reproduce the issue:
  • Create a new solution via Abp Suite or Abp Studio
  • browse localhost:4200 not switch "remember me" and log in
  • close the browser (not tab)
  • open the browser and open localhost:4200 (Shouldn't be logged in but logged in)

The "remember me" feature, whether it is authorization code or resource owner password, does not work properly in Angular. It is said that work is being done here, but it has not been fixed.


8 Answer(s)
  • User Avatar
    0
    ademaygun created

    Hi, Just checking if there's any update on my issue. Thanks

  • User Avatar
    0
    sumeyye.kurtulus created
    Support Team Angular Expert

    Hello, I have investigated this case with the related fix that you have mentioned. As the explanation implies here, the expected behavior is to check the related tokens together with the remember me option. So, the logic is not independent from them.

     private checkRememberMeOption() {
        const accessToken = this.oAuthService.getAccessToken();
        const isTokenExpire = isTokenExpired(this.oAuthService.getAccessTokenExpiration());
        let rememberMe = this.rememberMeService.get();
    
        if (accessToken && !rememberMe) {
          const rememberMeValue = this.rememberMeService.getFromToken(accessToken);
    
          this.rememberMeService.set(!!rememberMeValue);
        }
    
        rememberMe = this.rememberMeService.get();
        if (accessToken && isTokenExpire && !rememberMe) {
          this.rememberMeService.remove();
          this.oAuthService.logOut();
        }
      }
    
  • User Avatar
    0
    ademaygun created

    Hi Sumeyye, I don't understand what you mean. The "remember me" feature should work as @Sinan997 mentioned, but I don't think it does. Have you tried creating a new project?

  • User Avatar
    0
    sumeyye.kurtulus created
    Support Team Angular Expert

    Hello, actually, I meant that we are checking whether the access token is expired to make the user stay logged in.

    If your token is not expired, the user will not be kicked out regardless of checking the ‘remember me’ option. The remember me feature ensures that the user can stay logged in for both cases (access token is expired or not).

  • User Avatar
    0
    ademaygun created

    Hello, But In MVC login(authorization code), if "remember me" is not active, when we close and open the browser, it asks us to log in again.

  • User Avatar
    0
    sumeyye.kurtulus created
    Support Team Angular Expert

    Actually, it should behave in the same way as you can see in this recording https://drive.google.com/file/d/14XC2Ay4W7Af5qMHDn3xzGV7xgfS82XVw/view

  • User Avatar
    0
    ademaygun created

    Hello Sumeyye, I apologize for my incorrect expression. Can you please try the same test by entering this address: https://localhost:44326/account/login instead of http://localhost:4200. (Do not start the Angular project)

  • User Avatar
    0
    sumeyye.kurtulus created
    Support Team Angular Expert

    There is no problem. It is my duty to check and respond. However, the MVC project should also handle it in the same way.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 26, 2024, 06:07