update wco apxauth to align it with the BE
This commit is contained in:
@@ -351,7 +351,8 @@ apx.apxauth.recoverykey = (id, aliasoremail) => {
|
||||
return false;
|
||||
}
|
||||
const recodata = { tribe: apx.data.headers.xtribe, search: aliasoremail };
|
||||
recodata.emailalias = Checkjson.testformat(aliasoremail, "email")
|
||||
const validator= new Checkjson({properties:{email:{type:"string",format:"email"}}});
|
||||
recodata.emailalias = validator.verify({email:aliasoremail})
|
||||
? "email"
|
||||
: "alias";
|
||||
document.querySelector(`#${id} .msginfo`).innerHTML = "";
|
||||
@@ -561,7 +562,8 @@ apx.apxauth.createIdentity = async (id, alias, recoemail, passphrase = "") => {
|
||||
);
|
||||
return false;
|
||||
}
|
||||
if (recoemail.length > 0 && !Checkjson.testformat(recoemail, "email")) {
|
||||
const validator= new Checkjson({properties:{email:{type:"string",format:"email"}}});
|
||||
if (recoemail.length > 0 && !validator.verify({email:recoemail})) {
|
||||
apx.notification(`#${id} .msginfo`, {
|
||||
status: 406,
|
||||
ref: "Pagans",
|
||||
@@ -664,13 +666,10 @@ apx.apxauth.registerIdentity = async (id, trustedtribe) => {
|
||||
const data = {};
|
||||
data.alias = apx.data.tmpauth.keys.alias;
|
||||
data.publickey = apx.data.tmpauth.keys.publickey;
|
||||
console.log(
|
||||
apx.data.tmpauth.recoemail,
|
||||
Checkjson.testformat(apx.data.tmpauth.recoemail, "email")
|
||||
);
|
||||
const validator= new Checkjson({properties:{email:{type:"string",format:"email"}}});
|
||||
if (
|
||||
apx.data.tmpauth.recoemail &&
|
||||
Checkjson.testformat(apx.data.tmpauth.recoemail, "email")
|
||||
validator.verify({email:apx.data.tmpauth.recoemail})
|
||||
) {
|
||||
data.passphrase = apx.data.tmpauth.keyspassphrase;
|
||||
data.privatekey = apx.data.tmpauth.keysprivatekey;
|
||||
|
Reference in New Issue
Block a user