emberjs handle 401 not authorized

后端 未结 4 2129
情书的邮戳
情书的邮戳 2020-12-29 11:24

I am building an ember.js application and am hung up on authentication. The json rest backend is rails. Every request is authenticated using a session cookie (warden).

4条回答
  •  星月不相逢
    2020-12-29 12:13

    AFAIK this is not addressed by the current implementation of ember-data and the ember-data README states that "Handle error states" is on the Roadmap.

    For the time being, you can implement your own error handling adapter. Take a look at the implementation of the DS.RestAdapter . By using that as a starter, it should not be too difficult to add error handling in there (e.g simply add an error function to the the data hash that is passed to the jQuery.ajax call).

提交回复
热议问题