toggleShowMfa.off()}
- />
+
) : (
diff --git a/frontend/src/views/Login/Mfa.tsx b/frontend/src/views/Login/Mfa.tsx
index cd8d64059..4b43d2863 100644
--- a/frontend/src/views/Login/Mfa.tsx
+++ b/frontend/src/views/Login/Mfa.tsx
@@ -32,8 +32,8 @@ const codeInputProps = {
} as const;
type Props = {
- successCallback: () => void;
- closeMfa: () => void;
+ successCallback: () => void | Promise;
+ closeMfa?: () => void;
hideLogo?: boolean;
email: string;
};
@@ -58,8 +58,10 @@ export const Mfa = ({ successCallback, closeMfa, hideLogo, email }: Props) => {
SecurityClient.setMfaToken("");
SecurityClient.setToken(token);
- successCallback();
- closeMfa();
+ await successCallback();
+ if (closeMfa) {
+ closeMfa();
+ }
} catch (error) {
if (triesLeft) {
setTriesLeft((left) => {