Add profile modal

This commit is contained in:
2021-02-18 12:44:35 +01:00
parent edb5957cb2
commit 23f5e954c9
13 changed files with 245 additions and 25 deletions
+11 -1
View File
@@ -23,13 +23,23 @@ export class AuthService {
private router:Router
) {
this.headers = new HttpHeaders();
}
//if(!environment.production){
if (localStorage.getItem("user") != null) {
this.ValidatedUser = JSON.parse(localStorage.getItem('user'));
}
//}
}
public ValidatedUser:User;
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);
this.opts = {