log users out if they do not have curve keys. add curve keys to object on registration and login.

This commit is contained in:
ansuz
2017-07-05 17:19:28 +02:00
parent 4016a95540
commit e353627204
5 changed files with 22 additions and 3 deletions

View File

@@ -206,7 +206,8 @@ define([
}
// if the user is logged in, but does not have signing keys...
if (Cryptpad.isLoggedIn() && !Cryptpad.hasSigningKeys(proxy)) {
if (Cryptpad.isLoggedIn() && (!Cryptpad.hasSigningKeys(proxy) ||
!Cryptpad.hasCurveKeys(proxy))) {
return void requestLogin();
}
@@ -219,7 +220,6 @@ define([
Cryptpad.changeDisplayName(proxy[Cryptpad.displayNameKey]);
});
proxy.on('change', [tokenKey], function () {
console.log('wut');
var localToken = tryParsing(localStorage.getItem(tokenKey));
if (localToken !== proxy[tokenKey]) {
return void requestLogin();