Add config option to force verification (#29)

* Add config option to force verification

If this is set, users will not have the option to skip verification
on login (they will still be able to reload and continue unverified,
currently). Default off.

* Test for complete security dialog

* I hadn't set up prettier
This commit is contained in:
David Baker
2024-09-11 21:55:00 +01:00
committed by GitHub
parent 75918f5b18
commit a701e3afd7
4 changed files with 87 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ import SetupEncryptionBody from "./SetupEncryptionBody";
import AccessibleButton from "../../views/elements/AccessibleButton";
import CompleteSecurityBody from "../../views/auth/CompleteSecurityBody";
import AuthPage from "../../views/auth/AuthPage";
import SdkConfig from "../../../SdkConfig";
interface IProps {
onFinished: () => void;
@@ -82,8 +83,10 @@ export default class CompleteSecurity extends React.Component<IProps, IState> {
throw new Error(`Unknown phase ${phase}`);
}
const forceVerification = SdkConfig.get("force_verification") ?? false;
let skipButton;
if (phase === Phase.Intro || phase === Phase.ConfirmReset) {
if (!forceVerification && (phase === Phase.Intro || phase === Phase.ConfirmReset)) {
skipButton = (
<AccessibleButton
onClick={this.onSkipClick}