FIX: Explicitly specify the format when loading /associate/{{token}}

In IE11, the browser returns the cached HTML response, rather than the JSON formatted response. A better solution may be to add a `Vary: Accept` header to all of our HTML responses, but this commit should solve the immediate issue.
This commit is contained in:
David Taylor 2019-09-13 17:22:43 +01:00
parent 0cfe47471f
commit b0211772cb

View File

@ -7,7 +7,7 @@ export default Discourse.Route.extend({
const params = this.paramsFor("associate-account");
this.replaceWith(`preferences.account`, this.currentUser).then(() =>
Ember.run.next(() =>
ajax(`/associate/${encodeURIComponent(params.token)}`)
ajax(`/associate/${encodeURIComponent(params.token)}.json`)
.then(model => showModal("associate-account-confirm", { model }))
.catch(popupAjaxError)
)