Virtual whiteboard for sketching hand-drawn like diagrams
fix: Added alert for bad encryption key (#3998)
Ishan Sharmae8b462cc3100
diff --git a/src/excalidraw-app/data/index.ts b/src/excalidraw-app/data/index.tsindex 14ea6ba053..a470f1f96a 100644--- a/src/excalidraw-app/data/index.ts+++ b/src/excalidraw-app/data/index.ts@@ -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;};diff --git a/src/locales/en.json b/src/locales/en.jsonindex 1df232cc4f..17ec527a3e 100644--- a/src/locales/en.json+++ b/src/locales/en.json@@ -157,7 +157,8 @@"imageDoesNotContainScene": "Importing images isn't supported at the moment.\n\nDid you want to import a scene? This image does not seem to contain any scene data. Have you enabled this during export?","cannotRestoreFromImage": "Scene couldn't be restored from this image file","invalidSceneUrl": "Couldn't import scene from the supplied URL. It's either malformed, or doesn't contain valid Excalidraw JSON data.",- "resetLibrary": "This will clear your library. Are you sure?"+ "resetLibrary": "This will clear your library. Are you sure?",+ "invalidEncryptionKey": "Encryption key must be of 22 characters. Live collaboration is disabled."},"toolBar": {"selection": "Selection",