Skip to content

armgit / ente

Public Imported from GitHub
0

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

Add TODO

Manav Rathi93380d05b454
diff --git a/web/packages/accounts/pages/passkeys/finish.tsx b/web/packages/accounts/pages/passkeys/finish.tsx
index 2b1a8b8e61..be52cc02ae 100644
--- a/web/packages/accounts/pages/passkeys/finish.tsx
+++ b/web/packages/accounts/pages/passkeys/finish.tsx
@@ -90,6 +90,10 @@ const saveCredentialsAndNavigateTo = async (
// - The plaintext "token" will be passed during fresh signups, where we
// don't yet have keys to encrypt it, the account itself is being created
// as we go through this flow.
+ // TODO(MR): Conceptually this cannot happen. During a _real_ fresh signup
+ // we'll never enter the passkey verification flow. Remove this code after
+ // making sure that it doesn't get triggered in cases where an existing
+ // user goes through the new user flow.
//
// - The encrypted `encryptedToken` will be present otherwise (i.e. if the
// user is signing into an existing account).
diff --git a/web/packages/next/types/credentials.ts b/web/packages/next/types/credentials.ts
index 950cfffcca..483377d301 100644
--- a/web/packages/next/types/credentials.ts
+++ b/web/packages/next/types/credentials.ts
@@ -9,7 +9,11 @@ export const KeyAttributes = z.object({}).passthrough();
*/
export const TwoFactorAuthorizationResponse = z.object({
id: z.number(),
+ /** TODO: keyAttributes is guaranteed to be returned by museum, update the
+ * types to reflect that. */
keyAttributes: KeyAttributes.nullish().transform(nullToUndefined),
+ /** TODO: encryptedToken is guaranteed to be returned by museum, update the
+ * types to reflect that. */
encryptedToken: z.string().nullish().transform(nullToUndefined),
});