From 37b38e0eb15a79bbda3cd0a1b502669b32e773dc Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Thu, 15 Oct 2026 14:33:03 +0200 Subject: fix(auth): the sign-up notice links the privacy statement, with a space MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The link under the Register button was glued to the sentence before it: htm drops whitespace that holds a line break, so "deleted.Legal information". It also pointed at the hub's /legal/ index. Where an account is created is where GDPR art. 13 owes the person the information about their data, so it now links the privacy statement itself — /legal/confidentialite.fr.txt in French, /legal/privacy-statement.en.txt in every other language — on the hub that served the page, like every legal link. The sidebar's "Legal information" is unchanged. Checked in Chrome and Firefox (headless), in English and French. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-hub/tests/test_privacy_link.py | 40 +++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 packages/meshbay-hub/tests/test_privacy_link.py (limited to 'packages/meshbay-hub/tests/test_privacy_link.py') diff --git a/packages/meshbay-hub/tests/test_privacy_link.py b/packages/meshbay-hub/tests/test_privacy_link.py new file mode 100644 index 0000000..f53c867 --- /dev/null +++ b/packages/meshbay-hub/tests/test_privacy_link.py @@ -0,0 +1,40 @@ +""" +The sign-up form links the hub's privacy statement, the information GDPR +art. 13 owes a person whose data is collected: the French text in French, +the English one in every other language. On the hub that served the page, +like every legal link (platform.legalUrl), never on a hub of somebody else's. +""" + +import json +import shutil +import subprocess + +import pytest +from spa_source import STATIC + +pytestmark = pytest.mark.skipif(shutil.which("node") is None, reason="no node") + + +def test_each_language_links_its_statement(): + probe = ( + f"import({json.dumps((STATIC / 'platform.js').as_uri())}).then(p => " + "process.stdout.write(JSON.stringify(['fr', 'en', 'de', 'pt-BR']" + ".map(l => p.privacyUrl(l)))))" + ) + out = subprocess.run(["node", "-e", probe], capture_output=True, text=True, check=True) + assert json.loads(out.stdout) == [ + "/legal/confidentialite.fr.txt", + "/legal/privacy-statement.en.txt", + "/legal/privacy-statement.en.txt", + "/legal/privacy-statement.en.txt", + ] + + +def test_the_sign_up_notice_links_it(): + source = (STATIC / "auth-page.js").read_text(encoding="utf-8") + notice = source[source.index("${t('register.legal_notice')}"):] + notice = notice[:notice.index("")] + assert "platform.privacyUrl(getLocale())" in notice + # htm drops whitespace that holds a line break: without it the link is + # glued to the sentence before it. + assert notice.startswith("${t('register.legal_notice')}${' '}") -- cgit v1.2.3