Skip to content

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

add providerAuthToken for MFA login

Sheen Capadngan0ef5779776e3
diff --git a/frontend/src/components/login/MFAStep.tsx b/frontend/src/components/login/MFAStep.tsx
index ef1f9d7542..6f1209eba5 100644
--- a/frontend/src/components/login/MFAStep.tsx
+++ b/frontend/src/components/login/MFAStep.tsx
@@ -52,10 +52,12 @@ interface VerifyMfaTokenError {
*/
export default function MFAStep({
email,
- password
+ password,
+ providerAuthToken,
}: {
email: string;
password: string;
+ providerAuthToken?: string;
}): JSX.Element {
const router = useRouter();
const [isLoading, setIsLoading] = useState(false);
@@ -77,6 +79,7 @@ export default function MFAStep({
const isLoginSuccessful = await attemptLoginMfa({
email,
password,
+ providerAuthToken,
mfaToken: mfaCode
});
@@ -136,11 +139,10 @@ export default function MFAStep({
<div className="flex flex-row items-baseline gap-1 text-sm">
<span className="text-bunker-400">{t('mfa.step2-resend-alert')}</span>
<u
- className={`font-normal ${
- isLoadingResend
- ? 'text-bunker-400'
- : 'text-primary-700 duration-200 hover:text-primary'
- }`}
+ className={`font-normal ${isLoadingResend
+ ? 'text-bunker-400'
+ : 'text-primary-700 duration-200 hover:text-primary'
+ }`}
>
<button disabled={isLoading} onClick={() => handleResendMfaCode()} type="button">
{isLoadingResend ? t('mfa.step2-resend-progress') : t('mfa.step2-resend-submit')}
diff --git a/frontend/src/components/utilities/attemptLoginMfa.ts b/frontend/src/components/utilities/attemptLoginMfa.ts
index b7d499817f..8c118d0bc0 100644
--- a/frontend/src/components/utilities/attemptLoginMfa.ts
+++ b/frontend/src/components/utilities/attemptLoginMfa.ts
@@ -23,10 +23,12 @@ const client = new jsrp.client();
const attemptLoginMfa = async ({
email,
password,
+ providerAuthToken,
mfaToken
}: {
email: string;
password: string;
+ providerAuthToken?: string,
mfaToken: string;
}): Promise<Boolean> => {
return new Promise((resolve, reject) => {
@@ -39,6 +41,7 @@ const attemptLoginMfa = async ({
const { salt } = await login1({
email,
clientPublicKey,
+ providerAuthToken,
});
const {
diff --git a/frontend/src/pages/login.tsx b/frontend/src/pages/login.tsx
index f32a851196..9caecf7ff7 100644
--- a/frontend/src/pages/login.tsx
+++ b/frontend/src/pages/login.tsx
@@ -91,6 +91,7 @@ export default function Login() {
<MFAStep
email={email || providerEmail}
password={password}
+ providerAuthToken={providerAuthToken}
/>
}