angularjs - Add access token to every request header in Angular js -
this question has answer here:
- angular js - set token on header default 2 answers
i working node js rest api. in authentication process api returns access token. need add access token every request common place.
you can use http interceptor
code looks follow
$httpprovider.interceptors.push(function($q, $cookies) { return { 'request': function(config) { config.headers['token'] = $cookies.logintokencookie; return config; } }; });
Comments
Post a Comment