diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index dd5153943..c82285dbf 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -11,8 +11,6 @@ import { PhotoService } from 'src/app/services/photo.service'; import { NotificationsService } from 'src/app/services/notifications.service'; import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { Token } from '../../models/token.model'; -import { AlertService } from 'src/app/services/alert.service'; -import { Storage } from '@ionic/storage'; /* import { Plugins, PushNotification, PushNotificationToken, PushNotificationActionPerformed } from '@capacitor/core'; @@ -40,9 +38,7 @@ export class LoginPage implements OnInit { private storageService: StorageService, private toastService: ToastService, private photoService: PhotoService, - public alertController: AlertController, - private alertService: AlertService, - private storage: Storage,) { } + public alertController: AlertController) { } ngOnInit() { @@ -129,24 +125,7 @@ export class LoginPage implements OnInit { domainName: environment.domain, BasicAuthKey: "" } - await this.authService.login(this.userattempt); - this.storage.get('login').then((login)=>{ - if (login) { - this.alertService.presentAlert('5'); - this.loginRocketChat(); - //this.storeUserIdANdToken(); - - 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.'); - } - - }); - - /* if (await this.authService.login(this.userattempt)) { - this.alertService.presentAlert('5'); + if (await this.authService.login(this.userattempt)) { this.loginRocketChat(); //this.storeUserIdANdToken(); @@ -155,7 +134,7 @@ export class LoginPage implements OnInit { 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');