Skip to content

armgit / ente

Public Imported from GitHub
0

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

Specialize

Manav Rathiac9cee8fa390
diff --git a/web/apps/auth/src/pages/auth.tsx b/web/apps/auth/src/pages/auth.tsx
index a187d5f568..7984cf946a 100644
--- a/web/apps/auth/src/pages/auth.tsx
+++ b/web/apps/auth/src/pages/auth.tsx
@@ -41,8 +41,8 @@ const Page: React.FC = () => {
useEffect(() => {
const fetchCodes = async () => {
- const masterKey = await masterKeyBytesFromSessionIfLoggedIn();
- if (!masterKey) {
+ const masterKeyBytes = await masterKeyBytesFromSessionIfLoggedIn();
+ if (!masterKeyBytes) {
stashRedirect("/auth");
void router.push("/");
return;
@@ -50,7 +50,7 @@ const Page: React.FC = () => {
try {
const { codes, timeOffset } =
- await getAuthCodesAndTimeOffset(masterKey);
+ await getAuthCodesAndTimeOffset(masterKeyBytes);
setCodes(codes);
setTimeOffset(timeOffset ?? 0);
} catch (e) {
diff --git a/web/apps/auth/src/services/remote.ts b/web/apps/auth/src/services/remote.ts
index 13e192b96a..a29632cd26 100644
--- a/web/apps/auth/src/services/remote.ts
+++ b/web/apps/auth/src/services/remote.ts
@@ -21,7 +21,7 @@ export interface AuthCodesAndTimeOffset {
}
export const getAuthCodesAndTimeOffset = async (
- masterKey: Uint8Array,
+ masterKeyBytes: Uint8Array,
): Promise<AuthCodesAndTimeOffset> => {
const authenticatorEntityKey = await getAuthenticatorEntityKey();
if (!authenticatorEntityKey) {
@@ -31,7 +31,7 @@ export const getAuthCodesAndTimeOffset = async (
const authenticatorKey = await decryptAuthenticatorKey(
authenticatorEntityKey,
- masterKey,
+ masterKeyBytes,
);
const { entities, timeOffset } =
@@ -263,7 +263,7 @@ export const getAuthenticatorEntityKey = async (): Promise<
*/
const decryptAuthenticatorKey = async (
remote: AuthenticatorEntityKey,
- masterKey: Uint8Array,
+ masterKeyBytes: Uint8Array,
) =>
decryptBox(
{
@@ -271,5 +271,5 @@ const decryptAuthenticatorKey = async (
// Remote calls it the header, but it really is the nonce.
nonce: remote.header,
},
- masterKey,
+ masterKeyBytes,
);