draft document are been listed and open on tiny

This commit is contained in:
Eudes Inácio
2023-07-06 12:20:57 +01:00
parent 01324ad022
commit e227f0d683
17 changed files with 288 additions and 56 deletions
+29
View File
@@ -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) {