Angular-auth-oidc-client: Refresh F5 causes userData to be lost

Created on 12 Jul 2017  路  8Comments  路  Source: damienbod/angular-auth-oidc-client

breaking_changes

Most helpful comment

@astegmaier yes, we have a problem here.

All 8 comments

from @astegmaier

There seems to be some problems calling oidcSecurityService.getToken() and oidcSecurityService.getUserData() Specifically:

a. They will work fine immediately after the user logs in, but if you hard-refresh and call them again, they return nothing
b. the getUserData() method does not work unless you wait a while (~2-3 seconds) after oidcSecurityService.authorizedCallback() starts before calling it. I might be doing something wrong, but if there is some kind of asynchronous dependency for getUserData(), maybe it should return a promise or observable?

Both (a) and (b) appear to be unrelated to the storage used (I see the same problem if I turn off prerendering and use the default sessionStorage), so I can file a new issue with more details if you'd like.

@astegmaier yes, we have a problem here.

Fixing in the branch

https://github.com/damienbod/angular-auth-oidc-client/tree/dev-refresh

requires breaking changes, the IsAuthorization is now a subscription

@robisim74 @FabianGosebrink good? also will be a new Version 1.3.0
Most also fix the userData

user data is now fixed, uses a subscription instead of a event

Hi @damienbod ,
When I display data from an API that requires an OIDC authentication token, and I hit the browser's refresh button (F5), the angular-auth module doesn't send the Authorization token in the http request's header. Only a "soft" refresh (i.e. calling the http method to re-fetch the data without F5) works.
Would you have any idea of what's wrong?

Best,
Victor

Was this page helpful?
0 / 5 - 0 ratings