This commit is contained in:
tiago.kayaya
2021-07-22 17:07:04 +01:00
parent 7e48d7bf31
commit c36d6d8ef7
+8 -6
View File
@@ -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<boolean> {
//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<boolean> = 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();
}
}