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:
parent
75918f5b18
commit
a701e3afd7
4 changed files with 87 additions and 1 deletions
|
@ -52,6 +52,8 @@ export interface IConfigOptions {
|
|||
auth_footer_links?: { text: string; url: string }[];
|
||||
};
|
||||
|
||||
force_verification?: boolean; // if true, users must verify new logins
|
||||
|
||||
map_style_url?: string; // for location-shared maps
|
||||
|
||||
embedded_pages?: {
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue