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

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -