Archive sessions whenever an identity key changes

Sessions established with the previous identity should no longer be used for
sending, so we should close them.

Since we've added this call to saveIdentity, we can omit the call to it after
profile fetches.

// FREEBIE
This commit is contained in:
lilia 2017-06-19 12:26:00 -07:00 committed by Scott Nonnenberg
parent 0056cbefc1
commit d7054f4b63
2 changed files with 4 additions and 6 deletions

View file

@ -457,7 +457,9 @@
nonblockingApproval : nonblockingApproval,
}).then(function() {
this.trigger('keychange', identifier);
resolve(true);
this.archiveAllSessions(identifier).then(function() {
resolve(true);
}, reject);
}.bind(this));
} else if (this.isNonBlockingApprovalRequired(identityRecord)) {
console.log("Setting approval status...");