You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auth.currentUser() doesn't accept a config param as Auth.login(user, config) does.
In case it needs to do the login, no config is sent and the 401 Status will be handled by the Interceptor (if set globally).
On my application, I configured the global 401 Interceptor and on some states I call the Auth.currentUser() before loading them :
Now, when the user is not logged in and tries to access that page, an Auth.login() call will be made which will respond with the 401 status and then caught by the interceptor. I need to skip the interception for this call so it can be redirected to login.
The text was updated successfully, but these errors were encountered:
Auth.currentUser() doesn't accept a config param as Auth.login(user, config) does.
In case it needs to do the login, no config is sent and the 401 Status will be handled by the Interceptor (if set globally).
On my application, I configured the global 401 Interceptor and on some states I call the Auth.currentUser() before loading them :
$stateProvider.state('feed', { url: "/feed", templateUrl: "feed.html", controller: "FeedController", controllerAs: "mainCtrl", resolve: { auth: ['$q', '$state', 'Auth', function($q, $state, Auth) { return Auth.currentUser().then( function(user) {}, function(error) { $state.go('login'); return $q.reject(error); }); }] } });
Now, when the user is not logged in and tries to access that page, an Auth.login() call will be made which will respond with the 401 status and then caught by the interceptor. I need to skip the interception for this call so it can be redirected to login.
The text was updated successfully, but these errors were encountered: