Skip to content

Commit 1e84825

Browse files
committed
In force-verify mode, prevent bypassing by cancelling device verification
1 parent e44ca88 commit 1e84825

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/components/structures/MatrixChat.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,8 +2003,17 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
20032003
};
20042004

20052005
// complete security / e2e setup has finished
2006-
private onCompleteSecurityE2eSetupFinished = (): void => {
2007-
// This is async but we making this function async to wait for it isn't useful
2006+
private onCompleteSecurityE2eSetupFinished = async (): Promise<void> => {
2007+
const forceVerify = await this.shouldForceVerification();
2008+
if (forceVerify) {
2009+
const isVerified = await MatrixClientPeg.safeGet().getCrypto()?.isCrossSigningReady();
2010+
if (!isVerified) {
2011+
// We must verify but we haven't yet verified - don't continue logging in
2012+
return;
2013+
}
2014+
}
2015+
2016+
// (This is async but we making this function async to wait for it isn't useful)
20082017
this.onShowPostLoginScreen().catch((e) => {
20092018
logger.error("Exception showing post-login screen", e);
20102019
});

0 commit comments

Comments
 (0)