| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This is the implementation of the concept described in Authentication in AngularJS (or similar) based application.
Launch demo here or switch to gh-pages branch for source code of the demo.
This module installs $http interceptor and provides the 'authService'.
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.
The 'authService' has only one method: #loginConfirmed(). You are responsible to invoke this method after user logged in. You may optionally pass in a data argument to the loginConfirmed method which will be passed on to the loginConfirmed $broadcast. This may be useful, for example if you need to pass through details of the user that was logged in. The 'authService' will then retry all the requests previously failed due to HTTP 401 response.
###Typical use case:
| Back | FazBrowse Home | New Git URL |