Merge pull request #5834 from matrix-org/travis/sponsored/security-disable-ui
Add ability to hide post-login encryption setup with customisation pointpull/21833/head
commit
8aa4b1a760
|
@ -84,6 +84,7 @@ import {replaceableComponent} from "../../utils/replaceableComponent";
|
|||
import RoomListStore from "../../stores/room-list/RoomListStore";
|
||||
import {RoomUpdateCause} from "../../stores/room-list/models";
|
||||
import defaultDispatcher from "../../dispatcher/dispatcher";
|
||||
import SecurityCustomisations from "../../customisations/Security";
|
||||
|
||||
/** constants for MatrixChat.state.view */
|
||||
export enum Views {
|
||||
|
@ -395,7 +396,11 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
|||
|
||||
const crossSigningIsSetUp = cli.getStoredCrossSigningForUser(cli.getUserId());
|
||||
if (crossSigningIsSetUp) {
|
||||
this.setStateForNewView({ view: Views.COMPLETE_SECURITY });
|
||||
if (SecurityCustomisations.SHOW_ENCRYPTION_SETUP_UI === false) {
|
||||
this.onLoggedIn();
|
||||
} else {
|
||||
this.setStateForNewView({view: Views.COMPLETE_SECURITY});
|
||||
}
|
||||
} else if (await cli.doesServerSupportUnstableFeature("org.matrix.e2e_cross_signing")) {
|
||||
this.setStateForNewView({ view: Views.E2E_SETUP });
|
||||
} else {
|
||||
|
|
|
@ -74,8 +74,20 @@ export interface ISecurityCustomisations {
|
|||
catchAccessSecretStorageError?: typeof catchAccessSecretStorageError,
|
||||
setupEncryptionNeeded?: typeof setupEncryptionNeeded,
|
||||
getDehydrationKey?: typeof getDehydrationKey,
|
||||
|
||||
/**
|
||||
* When false, disables the post-login UI from showing. If there's
|
||||
* an error during setup, that will be shown to the user.
|
||||
*
|
||||
* Note: when this is set to false then the app will assume the user's
|
||||
* encryption is set up some other way which would circumvent the default
|
||||
* UI, such as by presenting alternative UI.
|
||||
*/
|
||||
SHOW_ENCRYPTION_SETUP_UI?: boolean, // default true
|
||||
}
|
||||
|
||||
// A real customisation module will define and export one or more of the
|
||||
// customisation points that make up `ISecurityCustomisations`.
|
||||
export default {} as ISecurityCustomisations;
|
||||
export default {
|
||||
SHOW_ENCRYPTION_SETUP_UI: true,
|
||||
} as ISecurityCustomisations;
|
||||
|
|
Loading…
Reference in New Issue