Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

misc: addressed totp visibility issue

Sheen Capadngan8e2cfe2c03f2
diff --git a/frontend/src/components/auth/Mfa.tsx b/frontend/src/components/auth/Mfa.tsx
index 3eff8a89c8..762b0d8838 100644
--- a/frontend/src/components/auth/Mfa.tsx
+++ b/frontend/src/components/auth/Mfa.tsx
@@ -31,6 +31,25 @@ const codeInputProps = {
}
} as const;
+const codeInputPropsPhone = {
+ inputStyle: {
+ fontFamily: "monospace",
+ margin: "4px",
+ MozAppearance: "textfield",
+ width: "40px",
+ borderRadius: "5px",
+ fontSize: "24px",
+ height: "40px",
+ paddingLeft: "7",
+ backgroundColor: "#0d1117",
+ color: "white",
+ border: "1px solid #2d2f33",
+ textAlign: "center",
+ outlineColor: "#8ca542",
+ borderColor: "#2d2f33"
+ }
+} as const;
+
type Props = {
successCallback: () => void | Promise<void>;
closeMfa?: () => void;
@@ -172,6 +191,24 @@ export const Mfa = ({ successCallback, closeMfa, hideLogo, email, method }: Prop
</div>
)}
</div>
+ <div className="mx-auto mt-4 block w-max md:hidden">
+ {method === MfaMethod.EMAIL && (
+ <ReactCodeInput
+ name=""
+ inputMode="tel"
+ type="text"
+ fields={6}
+ onChange={setMfaCode}
+ className="mb-2 mt-2"
+ {...codeInputPropsPhone}
+ />
+ )}
+ {method === MfaMethod.TOTP && (
+ <div className="mb-4 mt-2">
+ <Input value={mfaCode} onChange={(e) => setMfaCode(e.target.value)} />
+ </div>
+ )}
+ </div>
{typeof triesLeft === "number" && (
<Error text={`Invalid code. You have ${triesLeft} attempt(s) remaining.`} />
)}
diff --git a/frontend/src/pages/middlewares/restrict-login-signup.tsx b/frontend/src/pages/middlewares/restrict-login-signup.tsx
index 97ffff7526..f85ea44f28 100644
--- a/frontend/src/pages/middlewares/restrict-login-signup.tsx
+++ b/frontend/src/pages/middlewares/restrict-login-signup.tsx
@@ -97,7 +97,11 @@ export const Route = createFileRoute("/_restrict-login-signup")({
}
if (!data.organizationId) {
- if (location.pathname.endsWith("select-organization")) return;
+ if (
+ location.pathname.endsWith("select-organization") ||
+ location.pathname.endsWith("verify-email")
+ )
+ return;
throw redirect({ to: "/login/select-organization" });
}
throw redirect({