1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-11-13 00:26:55 -05:00

Check for success instead of not failure for redirect

This commit is contained in:
Jack Foltz 2018-01-15 10:10:48 -05:00
parent d3de95c5dc
commit 0625e63595
Signed by: foltik
GPG Key ID: 303F88F996E95541

View File

@ -15,7 +15,7 @@ angular.module('AuthSvc', []).service('AuthService', ['$http', '$window', functi
},
data: user
}).then(function(res) {
if (res.status !== 401)
if (res.status === 200)
$window.location.href = '/home';
})
};
@ -43,8 +43,8 @@ angular.module('AuthSvc', []).service('AuthService', ['$http', '$window', functi
},
data: user
}).then(function(res) {
if (res.status === 401) return false;
$window.location.href = '/home';
if (res.status === 200)
$window.location.href = '/home';
});
};