mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
save
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user