From 9e610dbe4a6e918feda3241ea5f6514604c4ff38 Mon Sep 17 00:00:00 2001 From: Raquel Smith Date: Tue, 10 Dec 2024 11:36:41 -0800 Subject: [PATCH] fix: hit 2fa setup endpoint when the logic is mounted (#26813) --- frontend/src/scenes/authentication/twoFactorLogic.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/scenes/authentication/twoFactorLogic.ts b/frontend/src/scenes/authentication/twoFactorLogic.ts index 9f5c1e5eecb5a..43d31a7f4d189 100644 --- a/frontend/src/scenes/authentication/twoFactorLogic.ts +++ b/frontend/src/scenes/authentication/twoFactorLogic.ts @@ -37,6 +37,7 @@ export const twoFactorLogic = kea([ toggleTwoFactorSetupModal: (open: boolean) => ({ open }), toggleDisable2FAModal: (open: boolean) => ({ open }), toggleBackupCodesModal: (open: boolean) => ({ open }), + startSetup: true, }), reducers({ isTwoFactorSetupModalOpen: [ @@ -158,9 +159,13 @@ export const twoFactorLogic = kea([ actions.resetToken() } }, + startSetup: async () => { + await api.get('api/users/@me/two_factor_start_setup/') + }, })), afterMount(({ actions }) => { + actions.startSetup() actions.loadStatus() }), ])