Merge branch 'feature/chat' into developer

This commit is contained in:
tiago.kayaya
2021-01-25 12:00:05 +01:00
33 changed files with 1599 additions and 301 deletions
+5 -6
View File
@@ -27,8 +27,7 @@ export class AuthService {
public ValidatedUser:User;
async login(user: User): Promise<any> {
/* user.BasicAuthKey = 'Basic ' + btoa(user.domainName + '\\' + user.username + ':' + user.password); //conversão em base64 das credenciais inseridas */
async login(user: User): Promise<boolean> {
user.BasicAuthKey = 'Basic ' + btoa(user.username + '@' + user.domainName + ':' + user.password); //conversão em base64 das credenciais inseridas
const options = { headers: {'Authorization': user.BasicAuthKey }};
@@ -38,10 +37,10 @@ export class AuthService {
}
const service = environment.apiURL + "userauthentication/GetValidateAuth";
/* let result: boolean | PromiseLike<boolean>; */
let result: boolean | PromiseLike<boolean>;
let response: any;
/* result = await this.http.get<boolean>(service, options).toPromise(); */
result = await this.http.get<boolean>(service, options).toPromise();
response = await this.http.post<any>(environment.apiURL + "UserAuthentication/Login", '', this.opts).toPromise();
/* this.http.post(environment.apiURL + "UserAuthentication/Login", '', this.opts).subscribe(res=>{
this.storageService.store(AuthConnstants.USER, res);
@@ -50,12 +49,12 @@ export class AuthService {
console.log(user);
}); */
if (response)
if (result)
{
this.ValidatedUser = user;
this.storageService.store(AuthConnstants.USER, response);
}
return response;
return result;
}
logout(){