Skip to content
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

[Bug]: Missing EventTypes.CheckingAuthFinished for state isAuthenticated: false #1954

Open
FestimShyti opened this issue Jun 4, 2024 · 0 comments

Comments

@FestimShyti
Copy link

FestimShyti commented Jun 4, 2024

Version

7.1.0

Exception or error

File: `check-auth.service.ts`

if (isAuthenticated) {
    this.startCheckSessionAndValidation(config, allConfigs);

    if (!isCallback) {
        this.authStateService.setAuthenticatedAndFireEvent(allConfigs);
        this.userService.publishUserDataIfExists(config, allConfigs);
    }

    // This event moved here and fired only isAuthenticated: true
    this.publicEventsService.fireEvent(EventTypes.CheckingAuthFinished);
}
.
.
.

tap(({ isAuthenticated }) => {
    // Fire event should be here to handle both states for isAuthenticated...

    if (isAuthenticated) {
        this.autoLoginService.checkSavedRedirectRouteAndNavigate(config);
    }
}),

Steps to reproduce the behavior

When authenticated is false the flow does not trigger `EventTypes.CheckingAuthFinished`.
jagipas pushed a commit to jagipas/angular-auth-oidc-client that referenced this issue Jun 10, 2024
FabianGosebrink added a commit that referenced this issue Jun 11, 2024
Fix issue #1954: Ensure CheckingAuthFinished event fires regardless of authentication state
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