[Ember] How to change the status code of API response

For whatever reason, if you want to change the server response status code from 401 to 200, in my case, I need to suppress that particular response from error into message.

You need to change 2–3 files:

  1. isSuccess in jquery.js around line 8207, or here
isSuccess = status >= 200 && status < 300 || status === 304;

2. isSuccess in Ember-data/adapters/rest.js or override the isSuccess in Adapter Instance if you don’t want to make it global.

Afterward, just restart ember server. Remember, change only 1 part won’t work.

Show your support

Clapping shows how much you appreciated Alan Dong’s story.