Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit f3d38a0f authored by Joze RIHTARSIC's avatar Joze RIHTARSIC
Browse files

Update code for upload certificate for the user authentication.

parent 2fef5d71
No related branches found
No related tags found
No related merge requests found
......@@ -210,10 +210,7 @@ export class UserDetailsDialogComponent {
uploadCertificate(event) {
const file = event.target.files[0];
const reader = new FileReader();
reader.onload = (e) => {
this.certificateService.uploadCertificate$(reader.result).subscribe((res: CertificateRo) => {
this.certificateService.uploadCertificate$(file).subscribe((res: CertificateRo) => {
if (res && res.certificateId){
this.userForm.patchValue({
'subject': res.subject,
......@@ -231,12 +228,7 @@ export class UserDetailsDialogComponent {
this.alertService.exception('Error uploading certificate file ' + file.name, err);
}
);
};
reader.onerror = (err) => {
this.alertService.exception('Error reading certificate file ' + file.name, err);
};
reader.readAsBinaryString(file);
}
onCertificateToggleChanged({checked}: MatSlideToggleChange) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment