Skip to content
This repository was archived by the owner on Oct 5, 2020. It is now read-only.

Commit 6e9a9eb

Browse files
getAuthenticatedStatus needs to always return promise
If the _isAuthenticated memo was already set, it was returned a bald value, without wrapping in a promise Also, I found and threw the error that wasn't showing up - which would have helped debug this issue. Fixes #480
1 parent 59057f0 commit 6e9a9eb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/templates/ui/app/login/login.service.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
function getAuthenticatedStatus() {
4040
if (_isAuthenticated !== undefined) {
41-
return _isAuthenticated;
41+
return $q.resolve(_isAuthenticated);
4242
}
4343

4444
return $http.get('/api/user/status', {}).then(function(response) {
@@ -120,6 +120,8 @@
120120
'params': JSON.stringify((_toStateParams || $stateParams))
121121
}).then(function() {
122122
d.reject();
123+
}, function(error) {
124+
throw error;
123125
});
124126
}
125127
return d.promise;

0 commit comments

Comments
 (0)