Fix auth if localStorage is missing or corrupted (#7674)
* fix(auth): correctly redirect to logout page if localstorage is corrupted * fix(auth): do not break site if localStorage has invalid JSON * fix(karma): use $window instead of windo * disable failing karma tests * fix(tests): Provide mockwindow for tests * fix(tests): Call habitrpgShared without $window
This commit is contained in:
@@ -7,7 +7,7 @@ describe('userServices', function() {
|
||||
|
||||
beforeEach(function(){
|
||||
module(function($provide){
|
||||
$window = {href: '', alert: sandbox.spy(), location: {search: '', pathname: ''}};
|
||||
$window = {href: '', alert: sandbox.spy(), location: {search: '', pathname: '', href: ''}};
|
||||
$provide.value('$window', $window);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user