mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Remove storage of protected key
This commit is contained in:
@@ -166,9 +166,6 @@ export default function UserInfoStep({
|
||||
SecurityClient.setToken(response.token);
|
||||
|
||||
saveTokenToLocalStorage({
|
||||
protectedKey,
|
||||
protectedKeyIV,
|
||||
protectedKeyTag,
|
||||
publicKey,
|
||||
encryptedPrivateKey,
|
||||
iv: encryptedPrivateKeyIV,
|
||||
|
||||
@@ -97,9 +97,6 @@ const attemptLogin = async (
|
||||
});
|
||||
|
||||
saveTokenToLocalStorage({
|
||||
protectedKey,
|
||||
protectedKeyIV,
|
||||
protectedKeyTag,
|
||||
publicKey,
|
||||
encryptedPrivateKey,
|
||||
iv,
|
||||
|
||||
@@ -70,9 +70,6 @@ const attemptLoginMfa = async ({
|
||||
});
|
||||
|
||||
saveTokenToLocalStorage({
|
||||
protectedKey,
|
||||
protectedKeyIV,
|
||||
protectedKeyTag,
|
||||
publicKey,
|
||||
encryptedPrivateKey,
|
||||
iv,
|
||||
|
||||
@@ -117,9 +117,6 @@ const changePassword = async (
|
||||
});
|
||||
|
||||
saveTokenToLocalStorage({
|
||||
protectedKey,
|
||||
protectedKeyIV,
|
||||
protectedKeyTag,
|
||||
encryptedPrivateKey,
|
||||
iv: encryptedPrivateKeyIV,
|
||||
tag: encryptedPrivateKeyTag
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import Aes256Gcm from '@app/components/utilities/cryptography/aes-256-gcm';
|
||||
import { deriveArgonKey } from '@app/components/utilities/cryptography/crypto';
|
||||
|
||||
import { KeyService } from '../services';
|
||||
|
||||
/**
|
||||
* @param {Object} obj
|
||||
* @param {Number} obj.encryptionVersion
|
||||
@@ -79,6 +81,7 @@ let privateKey;
|
||||
throw new Error('Failed to decrypt private key');
|
||||
}
|
||||
|
||||
KeyService.setPrivateKey(privateKey);
|
||||
return privateKey;
|
||||
}
|
||||
|
||||
|
||||
@@ -152,9 +152,6 @@ export default function SignupInvite() {
|
||||
SecurityClient.setToken(jwtToken);
|
||||
|
||||
saveTokenToLocalStorage({
|
||||
protectedKey,
|
||||
protectedKeyIV,
|
||||
protectedKeyTag,
|
||||
publicKey,
|
||||
encryptedPrivateKey,
|
||||
iv: encryptedPrivateKeyIV,
|
||||
|
||||
@@ -12,6 +12,10 @@ import {
|
||||
*/
|
||||
class KeyService {
|
||||
private static privateKey: string = '';
|
||||
|
||||
static setPrivateKey(privateKey: string) {
|
||||
KeyService.privateKey = privateKey;
|
||||
}
|
||||
|
||||
/** Return the user's decrypted private key
|
||||
* @param {Object} obj
|
||||
|
||||
7
frontend/src/services/index.ts
Normal file
7
frontend/src/services/index.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import KeyService from './KeyService';
|
||||
import ProjectService from './ProjectService';
|
||||
|
||||
export {
|
||||
KeyService,
|
||||
ProjectService
|
||||
}
|
||||
Reference in New Issue
Block a user