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

After successful login, getIsAuthorized still returns false for a bit. #549

Closed
chtinnes opened this issue Jan 4, 2020 · 2 comments
Closed
Labels

Comments

@chtinnes
Copy link

chtinnes commented Jan 4, 2020

If I perform a call to getIsAuthorized() immediately after a successul login, it will return false.
Sleeping for a second solves the problem, but this is only a workaround.

I think, call to getIsAuthorized() and authorize() have to be synced somehow.

@chtinnes chtinnes changed the title After successful login, getIsAuthorized still returns false for some a bit. After successful login, getIsAuthorized still returns false for a bit. Jan 4, 2020
@yavuztor
Copy link

yavuztor commented Jan 7, 2020

If you are using a call to load_using_stsServer in your app initialization, then you might be experiencing the same issue as I did. The return type of load_using_stsServer is void, but it actually returns a promise that resolves with configuration retrieved from sts server. See,

This creates a race condition, because we cannot wait for that call to finish before moving onto initializing the angular app. I worked around this issue in my app by casting the oidcConfigService to any and casting the oidcConfigService.load_using_stsServer to Promise<any>. Angular awaits any promises returned in the app initializers.

yavuztor pushed a commit to yavuztor/angular-auth-oidc-client that referenced this issue Jan 7, 2020
damienbod added a commit that referenced this issue Jan 7, 2020
Resolve issue #549: Added return types for OIDC config service.
@damienbod damienbod added the bug label Apr 24, 2020
@damienbod
Copy link
Owner

fixed in version 11, thanks for reporting

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

No branches or pull requests

3 participants