diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index 2a69c3907..af5b6a178 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -30,7 +30,7 @@ export class AuthService { public alertController: AlertController, private localstoreService: LocalstoreService, private toastService: ToastService, - ) { + ) { this.headers = new HttpHeaders(); @@ -43,7 +43,7 @@ export class AuthService { } } - + async login(user: UserForm): Promise { //user.BasicAuthKey = 'Basic ' + btoa(user.username + '@' + user.domainName + ':' + user.password); @@ -56,7 +56,7 @@ export class AuthService { headers: this.headers, } const service = environment.apiURL + "userauthentication/GetValidateAuth"; - + let result: boolean | PromiseLike = false; let response: any; @@ -80,7 +80,7 @@ export class AuthService { return true; } - + } catch (error) { if(error.status == 0) { this.toastService.badRequest('Verifique a sua conexão com a internet e volte a tentar') @@ -89,7 +89,7 @@ export class AuthService { } return false; } - + } logout(){ @@ -103,6 +103,8 @@ export class AuthService { "password": user.password, } + console.log(postData); + let responseChat = await this.httpService.post('login', postData).toPromise(); if(responseChat){ console.log('Login to Rocket chat OK'); @@ -155,7 +157,7 @@ export class AuthService { message: message, buttons: ['OK'] }); - + await alert.present(); } }