angular-auth-oidc-client
angular-auth-oidc-client copied to clipboard
[Bug]: `isLoading$` never emits `false` when using the `AutoLoginAllRoutesGuard`
What Version of the library are you using? 14.1.2
Describe the bug
If you use the router guard AutoLoginAllRoutesGuard, the isLoading$ never emits false because the guard is not using the main OidcSecurityService where the observable is changed from true to false.
To Reproduce Steps to reproduce the behavior:
- Add the following code in the AppComponent in the sample-code-flow-auto-login-all-routes sample app:
constructor(oidcSecurityService: OidcSecurityService) {
oidcSecurityService.isLoading$.subscribe((isLoading) => {
console.log('ISLOADING', isLoading);
});
}
- Launch the sample project
- Connect using e-mail and password
- Look in the console for the string 'ISLOADING' => it will never display
false
Expected behavior
I would expect that the isLoading$ observable emits false once the config is loaded and the service is ready to be used even if it's the router guard who is doing the checkAuth call.
Desktop (please complete the following information):
- OS: Windows 10
- Browser Chrome
- Version 103