diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 302f8d8d3..4de2ff69b 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -59,8 +59,11 @@ export class LoginPage implements OnInit { this.authService.loginChat(this.postData).subscribe((res: any) =>{ this.storageService.store(AuthConnstants.AUTH, res.data); console.log('Login to Rocket chat OK'); + this.presentAlert('Login to Rocket chat OK'); + },(error:any) =>{ console.log('Network error'); + this.presentAlert('Network error '+error); }); } diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index 9529f4bb1..6b3a733be 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -28,7 +28,7 @@ export class AuthService { public ValidatedUser:User; async login(user: User): Promise { - user.BasicAuthKey = 'Basic ' + btoa(user.domainName + '\\' + user.username + ':' + user.password); //conversão em base64 das credenciais inseridas + user.BasicAuthKey = 'Basic ' + btoa(user.username + '@' + user.domainName + ':' + user.password); //conversão em base64 das credenciais inseridas const options = { headers: {'Authorization': user.BasicAuthKey }}; this.headers = this.headers.set('Authorization',user.BasicAuthKey);