Friday, 25 September 2015

AngularJS interceptor

I created AngularJS service and connection to server. On server side was Spring Security and I used CSRF. I'd like natty add this token to every request.

The best way to do that was create interceptor "csrfInterceptor"

App.config(["$httpProvider", function($httpProvider) {
    $httpProvider.interceptors.push("csrfInterceptor");
}]);

and push it into provider interceptor.

No comments:

Post a Comment