Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Unused

Manav Rathi2ebeed3b6fb5
diff --git a/web/packages/shared/error/index.ts b/web/packages/shared/error/index.ts
index ca120ad44c..51c55c5d2f 100644
--- a/web/packages/shared/error/index.ts
+++ b/web/packages/shared/error/index.ts
@@ -23,7 +23,6 @@ export function isApiErrorResponse(object: any): object is ApiErrorResponse {
export const CustomError = {
ETAG_MISSING: "no header/etag present in response body",
- KEY_MISSING: "encrypted key missing from localStorage",
FILE_TOO_LARGE: "file too large",
SUBSCRIPTION_EXPIRED: "subscription expired",
STORAGE_QUOTA_EXCEEDED: "storage quota exceeded",
@@ -41,7 +40,6 @@ export const CustomError = {
UPDATE_EXPORTED_RECORD_FAILED: "update file exported record failed",
EXPORT_STOPPED: "export stopped",
EXPORT_FOLDER_DOES_NOT_EXIST: "export folder does not exist",
- AUTH_KEY_NOT_FOUND: "auth key not found",
TWO_FACTOR_ENABLED: "two factor enabled",
};
diff --git a/web/packages/shared/user/index.ts b/web/packages/shared/user/index.ts
index ccd688ee3d..c20377a3dd 100644
--- a/web/packages/shared/user/index.ts
+++ b/web/packages/shared/user/index.ts
@@ -1,21 +1,19 @@
import { sharedCryptoWorker } from "ente-base/crypto";
import type { B64EncryptionResult } from "ente-base/crypto/libsodium";
-import { CustomError } from "ente-shared/error";
import { getKey } from "ente-shared/storage/sessionStorage";
+/**
+ * Deprecated, use {@link masterKeyFromSessionIfLoggedIn} instead.
+ */
export const getActualKey = async () => {
- try {
- const encryptionKeyAttributes: B64EncryptionResult =
- getKey("encryptionKey");
+ const encryptionKeyAttributes: B64EncryptionResult =
+ getKey("encryptionKey");
- const cryptoWorker = await sharedCryptoWorker();
- const key = await cryptoWorker.decryptB64(
- encryptionKeyAttributes.encryptedData,
- encryptionKeyAttributes.nonce,
- encryptionKeyAttributes.key,
- );
- return key;
- } catch {
- throw new Error(CustomError.KEY_MISSING);
- }
+ const cryptoWorker = await sharedCryptoWorker();
+ const key = await cryptoWorker.decryptB64(
+ encryptionKeyAttributes.encryptedData,
+ encryptionKeyAttributes.nonce,
+ encryptionKeyAttributes.key,
+ );
+ return key;
};