network security setup to clear text in gabinetedigital.local domain

This commit is contained in:
Paulo Pinto
2020-08-27 10:23:23 +01:00
parent 306c0ecd19
commit 11faf43465
4 changed files with 31 additions and 30 deletions
+26 -22
View File
@@ -30,13 +30,6 @@ export class LoginPage implements OnInit {
}
/* Function to validade the login inputs */
validateInput(){
this.userattempt = {
username: this.username,
password: this.password,
domainName: "",
BasicAuthKey: ""
}
return (
this.username.trim().length > 0
&& this.password.trim().length > 0
@@ -54,22 +47,33 @@ export class LoginPage implements OnInit {
await alert.present();
}
async Login(){
//Go to our home in home/feed.
if(this.validateInput()){
if (await this.authService.login(this.userattempt))
{
this.router.navigate(['/home/events']);
async Login(){
try {
//Go to our home in home/feed.
if(this.validateInput()){
this.userattempt = {
username: this.username,
password: this.password,
domainName: environment.domain,
BasicAuthKey: ""
}
if (await this.authService.login(this.userattempt))
{
this.router.navigate(['/home/events']);
}
else
{
/* this.toastService.presentToast('Não foi possível fazer login"'); */
this.presentAlert('O nome de utilizador e palavra-passe estão incorretas ou verifique a sua conexão com a internet e volte a tentar.');
}
}
else
{
/* this.toastService.presentToast('Não foi possível fazer login"'); */
this.presentAlert('O nome de utilizador e palavra-passe estão incorretas ou verifique a sua conexão com a internet e volte a tentar.');
}
}
else{
/* this.toastService.presentToast('Preencha todos campos'); */
this.presentAlert('Por favor, insira o seu nome de utilizador e palavra-passe.');
else{
/* this.toastService.presentToast('Preencha todos campos'); */
this.presentAlert('Por favor, insira o seu nome de utilizador e palavra-passe.');
}
} catch (error) {
this.presentAlert('Ocorreu um erro ao fazer login. Contacte o administrador de sistema.');
}
}
}