This repository has been archived by the owner on Apr 26, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We've been trying to develop a secure site where the token is saved off in a cookie, similar to this sample, but using document.cookie instead of local storage.
Esri IdentityManager is supposed to append this cookie to all calls to the arcgis server, but it isn't working. Some calls are still going through to the server without a token appended to the url. This change is an attempt to get the proxy to check the cookie and append the token whenever IdentityManager fails to do so.
Hopefully it's not just specific to our project and may be of some use to others. It's just one additional check if the proxy hasn't managed to recover a token.
I've also moved the storeToken logic into a method, as the same code appeared in a few places (and added a few log statements).