kandi X-RAY | angular-http-auth Summary
kandi X-RAY | angular-http-auth Summary
This is the implementation of the concept described in [Authentication in AngularJS (or similar) based application] There are releases for both AngularJS 1.0.x and 1.2.x, see [releases] Launch demo [here] or switch to [gh-pages] branch for source code of the demo.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Retry an http request .
- Call successCallback with success callback
- Call a deferred callback
angular-http-auth Key Features
angular-http-auth Examples and Code Snippets
Community Discussions
Trending Discussions on angular-http-auth
QUESTION
I am using a very basic angularJS code for a user login like this:
...ANSWER
Answered 2017-Sep-05 at 00:11The problem is that angular-http-auth
module intercepts the responses with status 401 or 403:
The
$http
interceptor does the following: the configuration object (this is the requested URL, payload and parameters) of every HTTP 401 response is buffered and everytime it happens, the event:auth-loginRequired message is broadcasted from$rootScope
.
To disable the 401 interceptor set ignoreAuthModule: true
:
Sometimes you might not want the interceptor to intercept a request even if one returns 401 or 403. In a case like this you can add
ignoreAuthModule: true
to the request config.
The module creates a new promise in pending state for 401 status. The response is buffered and you have a chance to call authService.loginConfirmed()
or authService.loginCancelled()
functions. The first one retries all the requests previously failed due to HTTP 401 response. When the second one cancels all pending requests previously failed and buffered due to HTTP 401 response.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install angular-http-auth
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page