Many changes

Edit event
This commit is contained in:
Tiago Kayaya
2020-11-24 13:46:13 +01:00
parent 4d841e765a
commit 835b0169b6
26 changed files with 880 additions and 84 deletions
+6 -6
View File
@@ -34,7 +34,7 @@ export class LoginPage implements OnInit {
ngOnInit() {
}
/* Function to validade the login inputs */
//Function to validade the login inputs
validateInput(){
return (
this.username.trim().length > 0
@@ -60,7 +60,7 @@ export class LoginPage implements OnInit {
if(res.data){
this.storageService.store(AuthConnstants.AUTH, res.data);
console.log('Log RockectChat OK');
/* console.log(res.data); */
//console.log(res.data);
}
else{
@@ -79,6 +79,7 @@ export class LoginPage implements OnInit {
async Login(){
try {
//Go to our home in home/feed.
//this.router.navigate(['/home/events']);
if(this.validateInput()){
this.userattempt = {
username: this.username,
@@ -86,20 +87,19 @@ export class LoginPage implements OnInit {
domainName: environment.domain,
BasicAuthKey: ""
}
if (await this.authService.login(this.userattempt))
{
if (await this.authService.login(this.userattempt)){
this.loginAction();
console.log('Log Gabinete Digital OK');
this.router.navigate(['/home/events']);
}
else
{
/* this.toastService.presentToast('Não foi possível fazer login"'); */
//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.toastService.presentToast('Preencha todos campos');
this.presentAlert('Por favor, insira o seu nome de utilizador e palavra-passe.');
}
} catch (error) {