mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Merge branch 'feature/calendar' of https://bitbucket.org/equilibriumito/gabinete-digital into developer-c
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user