fix registration

This commit is contained in:
_Bastler 2022-11-24 12:41:04 +01:00
parent 88bd69cbc6
commit 7391ff1147

View File

@ -107,14 +107,14 @@ export class RegisterComponent implements OnInit {
if (this.form.valid && !this.working) { if (this.form.valid && !this.working) {
this.working = true; this.working = true;
let pgpOption = { let pgpOption = {
userIds: [ { name: this.model.username, email: this.model.username + "@we.bstly.de" } ], userIDs: [{ name: this.model.username, email: this.model.username + "@we.bstly.de" }],
curve: "ed25519", curve: "ed25519",
} }
var pubKey, privKey var pubKey, privKey
openpgp.generateKey(pgpOption).then((key) => { openpgp.generateKey(pgpOption).then((key) => {
privKey = key.privateKeyArmored; privKey = key.privateKey;
pubKey = key.publicKeyArmored; pubKey = key.publicKey;
this.model.profileFields = [ this.model.profileFields = [
{ "name": "publicKey", "type": "BLOB", "visibility": "PROTECTED", "blob": pubKey } { "name": "publicKey", "type": "BLOB", "visibility": "PROTECTED", "blob": pubKey }
@ -159,6 +159,7 @@ export class RegisterComponent implements OnInit {
} }
for (let code in errors) { for (let code in errors) {
console.warn(code, errors[code]);
this.form.get(code).setErrors(errors[code]); this.form.get(code).setErrors(errors[code]);
} }
} }