Auto approve migration emails if the password is correct. Change Email Link dump to Critical to ensure it makes it into the logs. (#1069)
This commit is contained in:
parent
fb8d40c360
commit
bb5e0593a0
3 changed files with 32 additions and 33 deletions
|
@ -26,7 +26,7 @@ export class AddEmailToAccountMigrationModalComponent implements OnInit {
|
|||
error: string = '';
|
||||
|
||||
constructor(private accountService: AccountService, private modal: NgbActiveModal,
|
||||
private serverService: ServerService, private confirmService: ConfirmService) {
|
||||
private serverService: ServerService, private confirmService: ConfirmService, private toastr: ToastrService) {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
@ -40,25 +40,23 @@ export class AddEmailToAccountMigrationModalComponent implements OnInit {
|
|||
}
|
||||
|
||||
save() {
|
||||
this.serverService.isServerAccessible().subscribe(canAccess => {
|
||||
const model = this.registerForm.getRawValue();
|
||||
model.sendEmail = canAccess;
|
||||
this.accountService.migrateUser(model).subscribe(async (email) => {
|
||||
console.log(email);
|
||||
if (!canAccess) {
|
||||
// Display the email to the user
|
||||
this.emailLink = email;
|
||||
await this.confirmService.alert('Please click this link to confirm your email. You must confirm to be able to login. The link is in your logs. You may need to log out of the current account before clicking. <br/> <a href="' + this.emailLink + '" target="_blank">' + this.emailLink + '</a>');
|
||||
this.modal.close(true);
|
||||
} else {
|
||||
await this.confirmService.alert('Please check your email (or logs under "Email Link") for the confirmation link. You must confirm to be able to login.');
|
||||
this.modal.close(true);
|
||||
}
|
||||
const model = this.registerForm.getRawValue();
|
||||
model.sendEmail = false;
|
||||
this.accountService.migrateUser(model).subscribe(async () => {
|
||||
// if (!canAccess) {
|
||||
// // Display the email to the user
|
||||
// this.emailLink = email;
|
||||
// await this.confirmService.alert('Please click this link to confirm your email. You must confirm to be able to login. The link is in your logs. You may need to log out of the current account before clicking. <br/> <a href="' + this.emailLink + '" target="_blank">' + this.emailLink + '</a>');
|
||||
// this.modal.close(true);
|
||||
// } else {
|
||||
// await this.confirmService.alert('Please check your email (or logs under "Email Link") for the confirmation link. You must confirm to be able to login.');
|
||||
// this.modal.close(true);
|
||||
// }
|
||||
this.toastr.success('Email has been validated');
|
||||
this.modal.close(true);
|
||||
}, err => {
|
||||
this.error = err;
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue