fix: Added alert for bad encryption key (#3998)

This commit is contained in:
Ishan Sharma 2021-09-25 02:04:56 +05:30 committed by GitHub
parent c86c176e10
commit e8b462cc31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -137,6 +137,10 @@ export const decryptAESGEM = async (
export const getCollaborationLinkData = (link: string) => {
const hash = new URL(link).hash;
const match = hash.match(/^#room=([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+)$/);
if (match && match[2].length !== 22) {
window.alert(t("alerts.invalidEncryptionKey"));
return null;
}
return match ? { roomId: match[1], roomKey: match[2] } : null;
};