0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Fix auth header caching in ajax service

closes https://github.com/TryGhost/Ghost/issues/6884
- mark the `headers` method in the ajax service as "volatile" - it's dependent key was causing the auth headers to be cached on first use which would then cause 401 errors once the token had been refreshed externally

It would also be possible to add `session.authenticated.access_token` as a dependent key but the code-path and usage are minimal so I believe `.volatile()` is preferable as it means that it's not tied directly to the authorizer implementation.
This commit is contained in:
Kevin Ansfield 2016-06-13 11:40:08 +01:00
parent e308256601
commit 39a09ca28a

View file

@ -53,7 +53,7 @@ export default AjaxService.extend({
} }
return headers; return headers;
}), }).volatile(),
handleResponse(status, headers, payload) { handleResponse(status, headers, payload) {
if (this.isRequestEntityTooLargeError(status, headers, payload)) { if (this.isRequestEntityTooLargeError(status, headers, payload)) {