Skip to content

autoLoginPartialRoutesGuard and isAuthenticated$ conflict #1471

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
MadEddieFFS opened this issue May 6, 2025 · 0 comments
Open

autoLoginPartialRoutesGuard and isAuthenticated$ conflict #1471

MadEddieFFS opened this issue May 6, 2025 · 0 comments

Comments

@MadEddieFFS
Copy link

MadEddieFFS commented May 6, 2025

Describe the bug
I have the autoLoginPartialRoutesGuard on the main root of the site (although callback is not guarded). I run checkAuth on init of app.component. If the user refreshes the page they are presented with a blank screen. It is because the guard is preventing the route however the checkAuth is showing the user is auth'ed.

Expected behavior
I would expect the guard to allow the page load as the user is authenticated

Is it a race condition? I've also tried removing the checkAuth in the app.component and using the withAppInitializerAuthCheck() but it didn't help. I am using localstorage

Below shows that the guard blocks the route however oninit checkAuth() shows authenticated...after the route is blocked. This ALSO has withAppInitializerAuthCheck() running

 provideAuth(
      {
        loader: {
          provide: StsConfigLoader,
          useFactory: httpLoaderFactory,
          deps: [HttpClient, APP_BASE_HREF],
        },
      },
      withAppInitializerAuthCheck()
    ),

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant