Preventing HTTP Basic Auth Dialog using AngularJS Interceptors

前端 未结 3 945
我在风中等你
我在风中等你 2020-12-15 17:54

I\'m building an AngularJS (1.2.16) web app with a RESTful API, and I\'d like to send 401 Unauthorized responses for requests where authentication information is invalid or

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-15 18:18

    I had this issue together with Spring Boot Security (HTTP basic), and since Angular 1.3 you have to set $httpProvider.defaults.headers.common["X-Requested-With"] = 'XMLHttpRequest'; for the popup not to appear.

提交回复
热议问题