Skip to content

armgit / ente

Public Imported from GitHub
0

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

Do the same as the totp 2fa flow

Manav Rathi5297156229cf
diff --git a/web/packages/accounts/pages/passkeys/finish.tsx b/web/packages/accounts/pages/passkeys/finish.tsx
index dd7e750f0e..99e1e3f1da 100644
--- a/web/packages/accounts/pages/passkeys/finish.tsx
+++ b/web/packages/accounts/pages/passkeys/finish.tsx
@@ -4,7 +4,7 @@ import InMemoryStore, { MS_KEYS } from "@ente/shared/storage/InMemoryStore";
import { LS_KEYS, getData, setData } from "@ente/shared/storage/localStorage";
import { useRouter } from "next/router";
import React, { useEffect } from "react";
-import { appHomeRoute } from "../../services/redirect";
+import { PAGES } from "../../constants/pages";
import type { PageProps } from "../../types/page";
/**
@@ -14,9 +14,7 @@ import type { PageProps } from "../../types/page";
* invoked the passkey flow since it needs to save the obtained credentials
* in local storage (which is tied to the current origin).
*/
-const Page: React.FC<PageProps> = ({ appContext }) => {
- const { appName } = appContext;
-
+const Page: React.FC<PageProps> = () => {
const router = useRouter();
useEffect(() => {
@@ -29,7 +27,7 @@ const Page: React.FC<PageProps> = ({ appContext }) => {
const redirectURL = InMemoryStore.get(MS_KEYS.REDIRECT_URL);
InMemoryStore.delete(MS_KEYS.REDIRECT_URL);
- router.push(redirectURL ?? appHomeRoute(appName));
+ router.push(redirectURL ?? PAGES.CREDENTIALS);
}, []);
return (
diff --git a/web/packages/shared/components/VerifyMasterPasswordForm.tsx b/web/packages/shared/components/VerifyMasterPasswordForm.tsx
index 6f383e648a..58ee4fbdf4 100644
--- a/web/packages/shared/components/VerifyMasterPasswordForm.tsx
+++ b/web/packages/shared/components/VerifyMasterPasswordForm.tsx
@@ -20,6 +20,13 @@ export interface VerifyMasterPasswordFormProps {
) => void;
buttonText: string;
submitButtonProps?: ButtonProps;
+ /**
+ * A callback invoked when the form wants to get {@link KeyAttributes}.
+ *
+ * Returning `undefined` from this callback is not an error, in it signals
+ * to the form that some other form of second factor is enabled and the user
+ * has been redirected to a two factor verification page.
+ */
getKeyAttributes?: (kek: string) => Promise<KeyAttributes | undefined>;
srpAttributes?: SRPAttributes;
}