Skip to content

Commit

Permalink
Warning when disabling MFA (#232)
Browse files Browse the repository at this point in the history
* add displayWarning prop and use it on admin side

* display alert

* add test and option prop

* update comment

* always display 2fa warning
  • Loading branch information
benwaples authored Nov 21, 2023
1 parent 67c5dd9 commit 6ca92bd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ describe('Enable2FADialog', () => {
).toBeInTheDocument();
});

it('displays security warning ', () => {
expect(screen.queryByTestId('ReportProblemOutlinedIcon')).toBeInTheDocument();
});

describe('user clicks "Cancel" button', () => {
beforeEach(async () => {
await user.click(screen.getByRole('button', { name: 'Cancel' }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@
//
// SPDX-License-Identifier: Apache-2.0

import { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, TextField } from '@mui/material';
import {
Alert,
Button,
Dialog,
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
TextField,
} from '@mui/material';
import React from 'react';

const Disable2FADialog: React.FC<{
Expand All @@ -37,6 +46,10 @@ const Disable2FADialog: React.FC<{
<DialogTitle>Disable Multi-Factor Authentication?</DialogTitle>
<form onSubmit={handleOnSave}>
<DialogContent>
<Alert severity='warning' style={{ marginBottom: '10px', alignItems: 'center' }}>
Disabling MFA increases the risk of unauthorized access. For optimal account security, we highly
recommend keeping MFA enabled.
</Alert>
<DialogContentText>{contentText}</DialogContentText>

<TextField
Expand Down

0 comments on commit 6ca92bd

Please sign in to comment.