mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Improve page
This commit is contained in:
@@ -35,9 +35,7 @@ export class AuthService {
|
||||
|
||||
async login(user: User): Promise<boolean> {
|
||||
user.BasicAuthKey = 'Basic ' + btoa(user.username + '@' + user.domainName + ':' + user.password); //conversão em base64 das credenciais inseridas
|
||||
//if(!environment.production){
|
||||
localStorage.setItem('user', JSON.stringify(user) );
|
||||
//}
|
||||
|
||||
|
||||
const options = { headers: {'Authorization': user.BasicAuthKey }};
|
||||
this.headers = this.headers.set('Authorization',user.BasicAuthKey);
|
||||
@@ -52,12 +50,14 @@ export class AuthService {
|
||||
result = await this.http.get<boolean>(service, options).toPromise();
|
||||
response = await this.http.post<any>(environment.apiURL + "UserAuthentication/Login", '', this.opts).toPromise();
|
||||
|
||||
console.log(response);
|
||||
|
||||
|
||||
if (result)
|
||||
{
|
||||
this.ValidatedUser = user;
|
||||
|
||||
//if(!environment.production){
|
||||
localStorage.setItem('user', JSON.stringify(Object.assign(user, response) ) );
|
||||
//}
|
||||
|
||||
this.storageService.store(AuthConnstants.USER, response);
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user