angularjs - Add skipauthorization to request object using Restangular -


i'm using satellizer handle authentication on app, default satellizer intercepts request , adds authorization header. request api using restangular don't want send authorization header in request make, example login , signup endpoints doesn't need header. if add skipauthorization: true request object, satellizer won't add authorization header. question is, how can add the skipauthorization property of request using restangular.

i tried

restangular.all('signup').withhttpconfig({'skipauthorization': true}).post(user) 

but "withhttpconfig" not function i'm loooking for.

you need write request interceptor:

// set full request interceptor  restangularprovider.setfullrequestinterceptor(function (element, operation, route, url, headers, params, httpconfig) {    return {     element: element,     params: params,     headers: headers,     httpconfig: _.extend(httpconfig, {skipauthorization: true})   };  }); 

Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -