From 5105a52a7b59e2ec3b6f74e5771ef976036a1ff7 Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Mon, 26 Apr 2021 15:03:05 +0000 Subject: [PATCH] [dashboard] users to www when logged out We want to redirect not logged in users from the root URL with no additional context provided to the website. fixes https://github.com/gitpod-io/gitpod/issues/3898 --- components/dashboard/src/App.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/dashboard/src/App.tsx b/components/dashboard/src/App.tsx index b9bff9632e954a..e9a301d73a5206 100644 --- a/components/dashboard/src/App.tsx +++ b/components/dashboard/src/App.tsx @@ -79,7 +79,13 @@ function App() { } window.removeEventListener('storage', updateTheme); } - }, [localStorage.theme]); + }, []); + + if ((window.location.hostname === 'gitpod.io' || window.location.hostname === 'gitpod-staging.com' || window.location.hostname.endsWith('gitpod-dev.com')) + && window.location.pathname === '/' && window.location.hash === '' && !loading && !user) { + window.location.href = `https://www.gitpod.io`; + return
; + } if (loading) { return