Refresh auth credentials prospective fixes
- Initial credentials refresh right after auth error to clear cache and to handle situation of auth error because of stale auth cookie. - Clear REST API cache entirely to remove all auth-dependent data. Bug: Issue 4285 Change-Id: I310ac9443ddd46c15d3c34c32d843a0af6db50df
This commit is contained in:
@@ -100,6 +100,9 @@
|
|||||||
this.listen(document, 'visibilitychange', '_handleVisibilityChange');
|
this.listen(document, 'visibilitychange', '_handleVisibilityChange');
|
||||||
}
|
}
|
||||||
this._requestCheckLoggedIn();
|
this._requestCheckLoggedIn();
|
||||||
|
if (!document.hidden) {
|
||||||
|
this._handleVisibilityChange();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_createToastAlert: function() {
|
_createToastAlert: function() {
|
||||||
|
@@ -105,7 +105,7 @@ limitations under the License.
|
|||||||
|
|
||||||
var hideToastSpy = sandbox.spy(toast, 'hide');
|
var hideToastSpy = sandbox.spy(toast, 'hide');
|
||||||
|
|
||||||
assert.isFalse(refreshStub.called);
|
assert.isTrue(refreshStub.called);
|
||||||
element.flushDebouncer('checkLoggedIn');
|
element.flushDebouncer('checkLoggedIn');
|
||||||
flush(function() {
|
flush(function() {
|
||||||
assert.isTrue(refreshStub.called);
|
assert.isTrue(refreshStub.called);
|
||||||
|
@@ -251,7 +251,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
refreshCredentials: function() {
|
refreshCredentials: function() {
|
||||||
this._cache['/accounts/self/detail'] = undefined;
|
this._cache = {};
|
||||||
return this.getLoggedIn();
|
return this.getLoggedIn();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user