Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
} else {
this.identityhash = res.identityhash;
this.appstore = await BeetClientDB.apps.add({
apphash: this.apphash,
identityhash: this.identityhash,
chain: this.chain,
appName: this.appName,
secret: this.secret.toString('hex'),
next_id: next_id
});
this.authenticated = res.authenticate;
this.linked = res.link;
this.identity = await BeetClientDB.apps.where("identityhash").equals(this.identityhash).first();
console.debug("app fetched", this.identity);
this.otp = new OTPAuth.HOTP({
issuer: "Beet",
label: "BeetAuth",
algorithm: "SHA1",
digits: 32,
counter: 0,
secret: OTPAuth.Secret.fromHex(this.identity.secret)
});
this.identity = Object.assign(this.identity, res.requested);
console.groupEnd();
resolve(this.identityhash);
}
}).catch(rej => {
console.debug("link rejected", rej);