ember.js - Ember get current url in RESTadapter -
using ember 1.13.2 ember data 1.13.4 in conjunction rails backend.
trying implement hmac authentication ember , ember data (restadapter)
class authhelper authheader: (adapter)-> ... frontend.applicationadapter = ds.restadapter.extend( headers: (-> 'authorization': new authhelper().authheader(@) ).property().volatile())
for need url request going send to.
how can url? or need construct manually collecting host , pluralized models name? get params ?
update
i able accomplish following code:
ember.$.ajaxprefilter (options, oriopt, jqxhr) -> authheader = authhelper.authheader(options.url) jqxhr.setrequestheader("authorization", authheader) return
the complete solution can found here: https://github.com/psunix/js-frameworks-api-auth
maybe knows more ember way doing this.
Comments
Post a Comment