fix broken register/login process

This commit is contained in:
ansuz 2017-11-24 15:12:00 +01:00
parent a3c093838c
commit 701af29192
3 changed files with 12 additions and 3 deletions

View file

@ -5,9 +5,11 @@ define([
'/common/common-util.js',
'/common/outer/network-config.js',
'/common/credential.js',
'/bower_components/chainpad/chainpad.dist.js',
'/bower_components/tweetnacl/nacl-fast.min.js',
'/bower_components/scrypt-async/scrypt-async.min.js', // better load speed
], function ($, Listmap, Crypto, Util, NetConfig, Cred) {
], function ($, Listmap, Crypto, Util, NetConfig, Cred, ChainPad) {
var Exports = {
Cred: Cred,
};
@ -64,6 +66,8 @@ define([
validateKey: opt.keys.validateKey, // derived validation key
crypto: Crypto.createEncryptor(opt.keys),
logLevel: 1,
classic: true,
ChainPad: ChainPad,
};
var rt = opt.rt = Listmap.create(config);
@ -133,7 +137,7 @@ define([
return void cb('ALREADY_REGISTERED', res);
}
cb(void 0, res);
setTimeout(function () { cb(void 0, res); });
});
});
};

View file

@ -52,6 +52,11 @@ define([
return hash;
};
var setUserHash = LocalStore.setUserHash = function (hash) {
var sHash = Hash.serializeHash(hash);
localStorage[Constants.userHashKey] = sHash;
};
LocalStore.getAccountName = function () {
return localStorage[Constants.userNameKey];
};

View file

@ -60,7 +60,7 @@ define([
window.alert("Test passed!");
return;
}
localStorage.User_hash = result.userHash;
LocalStore.setUserHash(result.userHash);
var proxy = result.proxy;
proxy.edPublic = result.edPublic;