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:
Matteo Pagliazzi
2016-06-17 12:14:41 +02:00
committed by GitHub
parent 5a3082bd88
commit a424892dd3
6 changed files with 59 additions and 29 deletions
+1 -1
View File
@@ -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);
});