-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Michael Matloka <[email protected]>
- Loading branch information
1 parent
bd13719
commit 58e51ff
Showing
19 changed files
with
534 additions
and
257 deletions.
There are no files selected for viewing
Binary file modified
BIN
+156 Bytes
(100%)
frontend/__snapshots__/scenes-other-login--second-factor--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.43 KB
(100%)
frontend/__snapshots__/scenes-other-login--second-factor--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-11 KB
(95%)
frontend/__snapshots__/scenes-other-settings--settings-user--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-11.7 KB
(94%)
frontend/__snapshots__/scenes-other-settings--settings-user--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
frontend/src/scenes/authentication/TwoFactorSetupModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { useActions, useValues } from 'kea' | ||
import { LemonBanner } from 'lib/lemon-ui/LemonBanner' | ||
import { LemonModal } from 'lib/lemon-ui/LemonModal' | ||
|
||
import { twoFactorLogic } from './twoFactorLogic' | ||
import { TwoFactorSetup } from './TwoFactorSetup' | ||
|
||
interface TwoFactorSetupModalProps { | ||
onSuccess: () => void | ||
closable?: boolean | ||
required?: boolean | ||
forceOpen?: boolean | ||
} | ||
|
||
export function TwoFactorSetupModal({ | ||
onSuccess, | ||
closable = true, | ||
required = false, | ||
forceOpen = false, | ||
}: TwoFactorSetupModalProps): JSX.Element { | ||
const { isTwoFactorSetupModalOpen } = useValues(twoFactorLogic) | ||
const { toggleTwoFactorSetupModal } = useActions(twoFactorLogic) | ||
|
||
return ( | ||
<LemonModal | ||
title="Set up two-factor authentication" | ||
isOpen={isTwoFactorSetupModalOpen || forceOpen} | ||
onClose={closable ? () => toggleTwoFactorSetupModal(false) : undefined} | ||
closable={closable} | ||
> | ||
<div className="max-w-md"> | ||
{required && ( | ||
<LemonBanner className="mb-4" type="warning"> | ||
Your organization requires you to set up 2FA. | ||
</LemonBanner> | ||
)} | ||
<p>Use an authenticator app like Google Authenticator or 1Password to scan the QR code below.</p> | ||
<TwoFactorSetup | ||
onSuccess={() => { | ||
toggleTwoFactorSetupModal(false) | ||
if (onSuccess) { | ||
onSuccess() | ||
} | ||
}} | ||
/> | ||
</div> | ||
</LemonModal> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.