mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
draft document are been listed and open on tiny
This commit is contained in:
@@ -100,6 +100,35 @@ export class AuthService {
|
||||
|
||||
}
|
||||
|
||||
async loginContenteProduction(user: UserForm, {saveSession = true}): Promise<LoginUserRespose> {
|
||||
user.BasicAuthKey = 'Basic ' + btoa(user.username + ':' + this.aesencrypt.encrypt(user.password,user.username ));
|
||||
|
||||
this.headers = this.headers.set('Authorization', user.BasicAuthKey);
|
||||
this.opts = {
|
||||
headers: this.headers,
|
||||
}
|
||||
|
||||
let response: any;
|
||||
|
||||
try {
|
||||
response = await this.http.post<LoginUserRespose>(environment.apiURL + "UserAuthentication/LoginJwt", '', this.opts).toPromise();
|
||||
|
||||
|
||||
if(saveSession) {
|
||||
/* this.SetSession(response, user) */
|
||||
this.storageService.store('userContentProduction',response)
|
||||
this.storageService.get('userContentProduction').then((value) =>{
|
||||
console.log('JWW', value.AuthorizationJwt);
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
return response
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// async UpdateLogin() {}
|
||||
|
||||
SetSession(response: LoginUserRespose, user:UserForm) {
|
||||
|
||||
Reference in New Issue
Block a user