Skip to content

Commit 344b65d

Browse files
authored
refresh modal on location change (#640)
1 parent 3572e3c commit 344b65d

File tree

1 file changed

+8
-2
lines changed
  • src/pages/client/pages/ClientInstancePage/components/LocationsList/modals/MFAModal

1 file changed

+8
-2
lines changed

src/pages/client/pages/ClientInstancePage/components/LocationsList/modals/MFAModal/MFAModal.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,16 @@ export const MFAModal = () => {
8888
setStartResponse(undefined);
8989
};
9090

91-
const resetAuthState = () => {
91+
const resetAuthState = useCallback(() => {
9292
setScreen('start');
9393
setStartResponse(undefined);
94-
};
94+
}, []);
95+
96+
useEffect(() => {
97+
if (location) {
98+
resetAuthState();
99+
}
100+
}, [location, resetAuthState]);
95101

96102
// selectedMethod: 0 = authenticator app, 1 = email, 2 = OpenID, 3 = MobileApprove
97103
const startMFA = useCallback(

0 commit comments

Comments
 (0)