Summary Table

Categories Total Count
PII 0
URL 0
DNS 0
EKL 0
IP 0
PORT 0
VsID 0
CF 0
AI 0
VPD 0
PL 0
Other 0

File Content

import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { AuthenticationService } from '../auth/auth.service';
import { DomSanitizer } from '@angular/platform-browser';
import { SsoEncodedUrlsModel } from '../auth/auth.model';
import { CanDeactivateGuard } from '../shared/guards/can-deactivate-gaurd';
import { environment } from '../../environments/environment';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.scss']
})
export class LoginComponent implements OnInit {
constructor(
private authenticationService: AuthenticationService,
private sanitizer: DomSanitizer,
private route: ActivatedRoute,
private canDeactivateGuard: CanDeactivateGuard
) {}

errorMsg = '';
errorStatus = false;
safeUrl;
sso: SsoEncodedUrlsModel;
userInfo: any = {};
userName = '';
attachmentId: string = null;

ngOnInit() {
this.route.queryParams.subscribe(param => {
if (param['attachmentId']) {
this.attachmentId = param['attachmentId'];
}
});

this.authenticationService.getErrorMsg().subscribe(error => {
this.errorMsg = error.errorMsg;
this.errorStatus = error.errorStatus;
});
if (this.attachmentId) {
this.authenticationService.ssoUrls(this.attachmentId).subscribe(
data => {
this.sso = data;
},
error => {
console.log(error);
this.errorMsg = error.message;
}
);
} else {
this.authenticationService.ssoUrls().subscribe(
data => {
this.sso = data;
},
error => {
console.log(error);
this.errorMsg = error.message;
}
);
}
this.safeUrl = this.sanitizer.bypassSecurityTrustUrl(
`${environment.hacssoserver}`
);
}

accept() {
this.canDeactivateGuard.setActive();
this.authenticationService.getNtName(this.sso).subscribe();
}
}