fix broken register/login process

pull/1/head
ansuz 7 years ago
parent a3c093838c
commit 701af29192

@ -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); });
});
});
};

@ -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];
};

@ -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;

Loading…
Cancel
Save