update CryptoES naming
This commit is contained in:
parent
cd2e49fba0
commit
9a0f139e7b
2 changed files with 9 additions and 9 deletions
|
|
@ -11,15 +11,15 @@ import {
|
|||
} from '@angular/fire/firestore';
|
||||
import { Task } from '../interfaces/task.interface';
|
||||
import { User } from '../interfaces/user.interface';
|
||||
import CryptoJS from 'crypto-es';
|
||||
import { CryptoJSSecretKey } from './../environments/config';
|
||||
import CryptoES from 'crypto-es';
|
||||
import { CryptoESSecretKey } from './../environments/config';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class FirebaseService implements OnDestroy {
|
||||
firestore: Firestore = inject(Firestore);
|
||||
private secretKey: string = CryptoJSSecretKey.secretKey;
|
||||
private secretKey: string = CryptoESSecretKey.secretKey;
|
||||
|
||||
allTasks: Task[] = [];
|
||||
filteredTasks: Task[] = [];
|
||||
|
|
@ -133,8 +133,8 @@ export class FirebaseService implements OnDestroy {
|
|||
getCurrentUserId() {
|
||||
const encryptedValue = localStorage.getItem('currentUserJOIN');
|
||||
if (encryptedValue) {
|
||||
const bytes = CryptoJS.AES.decrypt(encryptedValue, this.secretKey);
|
||||
const decryptedValue = bytes.toString(CryptoJS.enc.Utf8);
|
||||
const bytes = CryptoES.AES.decrypt(encryptedValue, this.secretKey);
|
||||
const decryptedValue = bytes.toString(CryptoES.enc.Utf8);
|
||||
return JSON.parse(decryptedValue);
|
||||
}
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ import {
|
|||
import { SharedService } from './shared.service';
|
||||
import { User } from '../interfaces/user.interface';
|
||||
import { Router } from '@angular/router';
|
||||
import CryptoJS from 'crypto-es';
|
||||
import { CryptoJSSecretKey } from './../environments/config';
|
||||
import CryptoES from 'crypto-es';
|
||||
import { CryptoESSecretKey } from './../environments/config';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
|
|
@ -34,7 +34,7 @@ export class LoginService {
|
|||
passwordIcon: string = './../../../assets/img/login/close-eye.svg';
|
||||
errorCode: string = '';
|
||||
|
||||
private secretKey: string = CryptoJSSecretKey.secretKey;
|
||||
private secretKey: string = CryptoESSecretKey.secretKey;
|
||||
|
||||
constructor(
|
||||
private firebaseService: FirebaseService,
|
||||
|
|
@ -188,7 +188,7 @@ export class LoginService {
|
|||
}
|
||||
|
||||
getUserIdInLocalStorage(userId: string): void {
|
||||
const encryptedValue = CryptoJS.AES.encrypt(
|
||||
const encryptedValue = CryptoES.AES.encrypt(
|
||||
JSON.stringify(userId),
|
||||
this.secretKey
|
||||
).toString();
|
||||
|
|
|
|||
Loading…
Reference in a new issue