From d4a7cf279cd9b061d6de88e7d7582ba57204f107 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Sun, 14 Jun 2026 00:08:02 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(frontend)=20allow=20hiding=20the=20lo?= =?UTF-8?q?gin=20button=20via=20a=20URL=20parameter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Required by some self-hosters who want to present a link to participants that are guests only, without access to their SSO. For example, a meeting between a citizen and a public servant where the guest is known not to have an account. Also useful when rendering the join page inside an iframe. --- CHANGELOG.md | 1 + src/frontend/src/layout/Header.tsx | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e60f7d9..b8d6abbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to ### Added - ✨(frontend) allow disabling silent login via a URL parameter +- ✨(frontend) allow hiding the login button via a URL parameter ### Changed diff --git a/src/frontend/src/layout/Header.tsx b/src/frontend/src/layout/Header.tsx index 8df8bd6d..550c774a 100644 --- a/src/frontend/src/layout/Header.tsx +++ b/src/frontend/src/layout/Header.tsx @@ -14,6 +14,7 @@ import { VisualOnlyTooltip } from '@/primitives/VisualOnlyTooltip' import { useLoginHint } from '@/hooks/useLoginHint' import { logout } from '@/features/auth/utils/logout' +import { useMemo } from 'react' const Logo = () => ( { ) } +const HIDE_LOGIN_PARAM = 'hideLogin' + +const isLoginButtonHidden = () => { + if (typeof window === 'undefined') return false + const value = new URLSearchParams(window.location.search).get( + HIDE_LOGIN_PARAM + ) + return value === 'true' +} + export const Header = () => { const { t } = useTranslation() const isHome = useMatchesRoute('home') @@ -92,6 +103,9 @@ export const Header = () => { const isTermsOfService = useMatchesRoute('termsOfService') const isRoom = useMatchesRoute('room') const { user, isLoggedIn } = useUser() + + const loginButtonDisabledByUrl = useMemo(() => isLoginButtonHidden(), []) + const userLabel = user?.full_name || user?.email const loggedInTooltip = t('loggedInUserTooltip') const loggedInAriaLabel = userLabel @@ -152,7 +166,8 @@ export const Header = () => { !isHome && !isLegalTerms && !isAccessibility && - !isTermsOfService && ( + !isTermsOfService && + !loginButtonDisabledByUrl && ( <>