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

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.

diff --git a/app/assets/javascripts/discourse/routes/associate-account.js.es6 b/app/assets/javascripts/discourse/routes/associate-account.js.es6
index dfbe2e5..d89654e 100644
--- a/app/assets/javascripts/discourse/routes/associate-account.js.es6
+++ b/app/assets/javascripts/discourse/routes/associate-account.js.es6
@@ -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)
       )

GitHub sha: b0211772

1 Like

This commit has been mentioned on Discourse Meta. There might be relevant details there: