From 4e012ef4873b2524c53028c82b5c4a0fdccceb50 Mon Sep 17 00:00:00 2001 From: Tom Vincent Date: Wed, 5 Oct 2016 13:48:23 +0200 Subject: [PATCH] fix: use navigator online to grant offline login Sometimes seeing different response statuses here (e.g. 500, though I'm not sure why). Revert to using naive `navigator.onLine` instead for offline login. Closes #13. --- src/login.service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/login.service.js b/src/login.service.js index 21dd2c5..96fcf1c 100644 --- a/src/login.service.js +++ b/src/login.service.js @@ -114,7 +114,7 @@ class LoginService { .then(remoteSession => isValidSession(localSession, remoteSession)) .then(() => this.init(localSession)) .catch(err => { - if (angular.isObject(err) && err.status === 0) { + if (!this.$window.navigator.onLine) { // User looks to be offline, grant login return this.init(localSession) }