This commit is contained in:
Manav Rathi 2024-05-25 10:10:19 +05:30
parent 711a44412d
commit 08073b927c
No known key found for this signature in database
2 changed files with 4 additions and 2 deletions

View file

@ -56,7 +56,8 @@ export default function SetupTwoFactor({ appName }: PageProps) {
...getData(LS_KEYS.USER),
isTwoFactorEnabled: true,
});
router.push(APP_HOMES.get(appName));
// TODO: Refactor the type of APP_HOMES to not require the ??
router.push(APP_HOMES.get(appName) ?? "/");
};
return (

View file

@ -4,6 +4,7 @@ import VerifyTwoFactor, {
} from "@ente/accounts/components/two-factor/VerifyForm";
import { PAGES } from "@ente/accounts/constants/pages";
import { ensure } from "@/utils/ensure";
import type { PageProps } from "@ente/shared/apps/types";
import { VerticallyCentered } from "@ente/shared/components/Container";
import FormPaper from "@ente/shared/components/Form/FormPaper";
@ -55,7 +56,7 @@ export const TwoFactorVerify: React.FC<PageProps> = ({
encryptedToken,
id,
});
setData(LS_KEYS.KEY_ATTRIBUTES, keyAttributes);
setData(LS_KEYS.KEY_ATTRIBUTES, ensure(keyAttributes));
const redirectURL = InMemoryStore.get(MS_KEYS.REDIRECT_URL);
InMemoryStore.delete(MS_KEYS.REDIRECT_URL);
router.push(redirectURL ?? PAGES.CREDENTIALS);