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
Using localStorage not working as expected #321
Comments
After some more searching I found that updating the { provide: OAuthStorage, useValue: localStorage }, ...does the trick. This makes the This same fix (as well a provider for the Not sure what options are supposed to work, but either the code or the docs need a few updates. If you could provide some guidance here (and an answer for #317) then I'd be happy to fire up a PR to fix things. |
Oh, this is a good finding. |
The next version will contain a depcreation information for this. |
I'm trying to use localStorage as a backing store to make sure new tabs in the same browser have instant access to access tokens if available. I find however that it always sends
Authorization: bearer null
.I'm mostly mimicking what's in the example (configuration wise). Here's a repro:
# Angular 5 CLI so using 3.x version of the lib ng new store-test --minimal npm i angular-oauth2-oidc@^3 --save
Add these to the module:
And change the component to:
I'm hosting the IdentityServer4 sample with implicit flow. The login/logout stuff works just fine. The
ajax()
call however will show up like this in Chrome:Even weirder, if I do
setStorage(myStore)
where I have this decorator:Then I see that all
get
calls properly return data, nevernull
.Am I configuring something incorrectly? Or have I found a bug?
The text was updated successfully, but these errors were encountered: