mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-11 21:28:59 +00:00
add providerAuthToken for MFA login
This commit is contained in:
@@ -52,10 +52,12 @@ interface VerifyMfaTokenError {
|
|||||||
*/
|
*/
|
||||||
export default function MFAStep({
|
export default function MFAStep({
|
||||||
email,
|
email,
|
||||||
password
|
password,
|
||||||
|
providerAuthToken,
|
||||||
}: {
|
}: {
|
||||||
email: string;
|
email: string;
|
||||||
password: string;
|
password: string;
|
||||||
|
providerAuthToken?: string;
|
||||||
}): JSX.Element {
|
}): JSX.Element {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
@@ -77,6 +79,7 @@ export default function MFAStep({
|
|||||||
const isLoginSuccessful = await attemptLoginMfa({
|
const isLoginSuccessful = await attemptLoginMfa({
|
||||||
email,
|
email,
|
||||||
password,
|
password,
|
||||||
|
providerAuthToken,
|
||||||
mfaToken: mfaCode
|
mfaToken: mfaCode
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -136,8 +139,7 @@ export default function MFAStep({
|
|||||||
<div className="flex flex-row items-baseline gap-1 text-sm">
|
<div className="flex flex-row items-baseline gap-1 text-sm">
|
||||||
<span className="text-bunker-400">{t('mfa.step2-resend-alert')}</span>
|
<span className="text-bunker-400">{t('mfa.step2-resend-alert')}</span>
|
||||||
<u
|
<u
|
||||||
className={`font-normal ${
|
className={`font-normal ${isLoadingResend
|
||||||
isLoadingResend
|
|
||||||
? 'text-bunker-400'
|
? 'text-bunker-400'
|
||||||
: 'text-primary-700 duration-200 hover:text-primary'
|
: 'text-primary-700 duration-200 hover:text-primary'
|
||||||
}`}
|
}`}
|
||||||
|
|||||||
@@ -23,10 +23,12 @@ const client = new jsrp.client();
|
|||||||
const attemptLoginMfa = async ({
|
const attemptLoginMfa = async ({
|
||||||
email,
|
email,
|
||||||
password,
|
password,
|
||||||
|
providerAuthToken,
|
||||||
mfaToken
|
mfaToken
|
||||||
}: {
|
}: {
|
||||||
email: string;
|
email: string;
|
||||||
password: string;
|
password: string;
|
||||||
|
providerAuthToken?: string,
|
||||||
mfaToken: string;
|
mfaToken: string;
|
||||||
}): Promise<Boolean> => {
|
}): Promise<Boolean> => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
@@ -39,6 +41,7 @@ const attemptLoginMfa = async ({
|
|||||||
const { salt } = await login1({
|
const { salt } = await login1({
|
||||||
email,
|
email,
|
||||||
clientPublicKey,
|
clientPublicKey,
|
||||||
|
providerAuthToken,
|
||||||
});
|
});
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ export default function Login() {
|
|||||||
<MFAStep
|
<MFAStep
|
||||||
email={email || providerEmail}
|
email={email || providerEmail}
|
||||||
password={password}
|
password={password}
|
||||||
|
providerAuthToken={providerAuthToken}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user