Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

Commit b42dc11

Browse files
committed
Bug 1129885 - [Loop] User (logged with MobileID) is logged out of the Loop application
1 parent 95cbe52 commit b42dc11

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

app/js/helpers/account_helper.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,18 @@
289289
debug && console.log('FxA: Ready');
290290
},
291291
onlogin: _onlogin,
292-
onlogout: _onlogout,
292+
onlogout: function() {
293+
// User could be logged into via MobileID so let's log the
294+
// user out if that's not the case.
295+
AccountHelper.getAccount(account => {
296+
if (!account ||
297+
!account.id ||
298+
!account.id.type ||
299+
(account.id.type === 'fxa')) {
300+
_onlogout();
301+
}
302+
});
303+
},
293304
onerror: function(err) {
294305
var errorName = JSON.parse(err).name;
295306
if (errorName !== 'OFFLINE') {

0 commit comments

Comments
 (0)