mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
new session service
This commit is contained in:
@@ -19,7 +19,7 @@ import { InitialsService } from './functions/initials.service';
|
||||
import { PermissionService } from './permission.service';
|
||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { DocumentManagementStore } from '../store/documentManagement';
|
||||
import { CPSession } from '../store/documentManagement';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -32,8 +32,6 @@ export class AuthService {
|
||||
opts:any;
|
||||
|
||||
tabIsActive = true
|
||||
|
||||
DocumentManagementStore = DocumentManagementStore
|
||||
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
@@ -78,9 +76,6 @@ export class AuthService {
|
||||
async login(user: UserForm, {saveSession = true}): Promise<LoginUserRespose> {
|
||||
user.BasicAuthKey = 'Basic ' + btoa(user.username + ':' + this.aesencrypt.encrypt(user.password,user.username ));
|
||||
|
||||
// Basic peter.maquiran@equilibrium.co.ao:senha123456
|
||||
// console.log(user.BasicAuthKey)
|
||||
|
||||
this.headers = this.headers.set('Authorization', user.BasicAuthKey);
|
||||
this.opts = {
|
||||
headers: this.headers,
|
||||
@@ -119,7 +114,8 @@ export class AuthService {
|
||||
|
||||
if(saveSession) {
|
||||
/* this.SetSession(response, user) */
|
||||
this.DocumentManagementStore.setData(response)
|
||||
console.log('teste', response);
|
||||
CPSession.save(response)
|
||||
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user