misc: removed remaining mfa handling

This commit is contained in:
Sheen Capadngan
2024-10-18 03:26:48 +08:00
parent bb079b3e46
commit 8eb668cd72
3 changed files with 1 additions and 35 deletions

View File

@@ -30,7 +30,6 @@ export const LoginSSO = ({ providerAuthToken }: Props) => {
email={username}
password={password}
setPassword={setPassword}
setStep={setStep}
/>
);
default:

View File

@@ -102,17 +102,7 @@ export const InitialStep = ({ setStep, email, setEmail, password, setPassword }:
if (isLoginSuccessful && isLoginSuccessful.success) {
// case: login was successful
if (isLoginSuccessful.mfaEnabled) {
// case: login requires MFA step
setStep(1);
setIsLoading(false);
return;
}
navigateToSelectOrganization();
// case: login does not require MFA step
createNotification({
text: "Successfully logged in",
type: "success"

View File

@@ -27,16 +27,9 @@ type Props = {
email: string;
password: string;
setPassword: (password: string) => void;
setStep: (step: number) => void;
};
export const PasswordStep = ({
providerAuthToken,
email,
password,
setPassword,
setStep
}: Props) => {
export const PasswordStep = ({ providerAuthToken, email, password, setPassword }: Props) => {
const [isLoading, setIsLoading] = useState(false);
const { t } = useTranslation();
const router = useRouter();
@@ -169,12 +162,6 @@ export const PasswordStep = ({
});
if (isCliLoginSuccessful && isCliLoginSuccessful.success) {
if (isCliLoginSuccessful.mfaEnabled) {
// case: login requires MFA step
setStep(2);
setIsLoading(false);
return;
}
const cliUrl = `http://127.0.0.1:${callbackPort}/`;
// case: organization ID is present from the provider auth token -- select the org and use the new jwt token in the CLI, then navigate to the org
@@ -237,16 +224,6 @@ export const PasswordStep = ({
if (loginAttempt && loginAttempt.success) {
// case: login was successful
if (loginAttempt.mfaEnabled) {
// TODO: deal with MFA
// case: login requires MFA step
setIsLoading(false);
setStep(2);
return;
}
// case: login does not require MFA step
setIsLoading(false);
createNotification({
text: "Successfully logged in",