update
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
|
||||
import { AuthService } from './../../services/auth.service';
|
||||
import { MatchingValidator } from './../../utils/matching.validator';
|
||||
|
||||
var openpgp = require('openpgp');
|
||||
@Component({
|
||||
selector: 'app-password',
|
||||
templateUrl: './password.component.html',
|
||||
styleUrls: ['./password.component.scss']
|
||||
})
|
||||
export class PasswordComponent implements OnInit {
|
||||
|
||||
model: any = {};
|
||||
public working: boolean;
|
||||
form: FormGroup;
|
||||
|
||||
constructor(private formBuilder: FormBuilder, private authService: AuthService) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.form = this.formBuilder.group({
|
||||
username: ['', Validators.required],
|
||||
privateKey: ['', Validators.required]
|
||||
});
|
||||
}
|
||||
|
||||
async passwordReset() {
|
||||
const { keys: [privateKey] } = await openpgp.key.readArmored(this.model.privateKey);
|
||||
|
||||
|
||||
console.log(privateKey.isPrivate());
|
||||
|
||||
const model = {
|
||||
username: this.model.username
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
const message = await openpgp.message.readArmored(encrypted);
|
||||
|
||||
const decrypted = await openpgp.decrypt({
|
||||
message: message,
|
||||
privateKeys: [privateKey]
|
||||
});
|
||||
|
||||
console.log(decrypted);
|
||||
// this.authService.passwordReset(model).subscribe(async response => { })
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user