Second pass

This commit is contained in:
Manav Rathi
2024-06-30 17:53:21 +05:30
parent 54c54d50c6
commit 284799bc7a
3 changed files with 7 additions and 9 deletions

View File

@@ -231,10 +231,8 @@ const Page: React.FC<PageProps> = ({ appContext }) => {
isTwoFactorPasskeysEnabled: true,
});
InMemoryStore.set(MS_KEYS.REDIRECT_URL, PAGES.ROOT);
const url = passkeyVerificationRedirectURL(
appName,
passkeySessionID,
);
const url =
passkeyVerificationRedirectURL(passkeySessionID);
setPasskeyVerificationData({ passkeySessionID, url });
openPasskeyVerificationURL({ passkeySessionID, url });
throw Error(CustomError.TWO_FACTOR_ENABLED);

View File

@@ -10,7 +10,7 @@ import { PAGES } from "../constants/pages";
import type { PageProps } from "../types/page";
const Page: React.FC<PageProps> = ({ appContext }) => {
const { appName, showNavBar } = appContext;
const { showNavBar } = appContext;
const [loading, setLoading] = useState(true);
const [host, setHost] = useState<string | undefined>();
@@ -38,7 +38,7 @@ const Page: React.FC<PageProps> = ({ appContext }) => {
) : (
<VerticallyCentered>
<FormPaper>
<Login {...{ appName, signUp, host }} />
<Login {...{ signUp, host }} />
</FormPaper>
</VerticallyCentered>
);

View File

@@ -10,7 +10,7 @@ import { SignUp } from "../components/SignUp";
import type { PageProps } from "../types/page";
const Page: React.FC<PageProps> = ({ appContext }) => {
const { appName } = appContext;
const { showNavBar } = appContext;
const [loading, setLoading] = useState(true);
const [host, setHost] = useState<string | undefined>();
@@ -24,7 +24,7 @@ const Page: React.FC<PageProps> = ({ appContext }) => {
router.push(PAGES.VERIFY);
}
setLoading(false);
appContext.showNavBar(true);
showNavBar(true);
}, []);
const login = () => {
@@ -37,7 +37,7 @@ const Page: React.FC<PageProps> = ({ appContext }) => {
<EnteSpinner />
) : (
<FormPaper>
<SignUp {...{ appName, login, router, host }} />
<SignUp {...{ login, router, host }} />
</FormPaper>
)}
</VerticallyCentered>