diff --git a/frontend/src/Routes.tsx b/frontend/src/Routes.tsx index 71a8516f2..160d4ce7c 100644 --- a/frontend/src/Routes.tsx +++ b/frontend/src/Routes.tsx @@ -19,7 +19,6 @@ const RemoteScheduler = () => import('./app/Scheduler/RemoteSchedulerPage'); const ViewSchedule = () => import('./app/Scheduler/ViewSchedule'); const PrivacyPolicy = () => import('./views/PrivacyPolicy'); const TermsOfService = () => import('./views/TermsOfService'); -const RedirectLink = () => import('./views/RedirectLink'); // const Apply = () => import('./views/Apply'); function ScheduleRedirect() { @@ -48,8 +47,7 @@ const router = createBrowserRouter([ { path: '/schedule/:scheduleId', lazy: ViewSchedule }, { path: '/error', Component: Error }, { path: '/legal/privacy', lazy: PrivacyPolicy }, - { path: '/legal/terms', lazy: TermsOfService }, - { path: '/redirect', lazy: RedirectLink }, + { path: '/legal/terms', lazy: TermsOfService } // { path: '/apply', lazy: Apply } ] }, diff --git a/frontend/src/views/RedirectLink.tsx b/frontend/src/views/RedirectLink.tsx deleted file mode 100644 index ee2eeb2be..000000000 --- a/frontend/src/views/RedirectLink.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { useNavigate, useLocation } from 'react-router-dom'; - -// We must have an allowlist of redirects to prevent an attacker from arbitrarily opening external sites. -const allowedRedirects = new Map([ - ['workshop-facebook', 'https://www.facebook.com/events/314954970047731'], - [ - 'workshop-register', - 'https://docs.google.com/forms/d/e/1FAIpQLSf92FiqIwMc5et1ZSI_Rj1NGi3Y7Rx2kyMl8uQLSX1QzDIsuQ/viewform?usp=sf_link' - ] -]); - -export function Component() { - const params = new URLSearchParams(useLocation().search); - const site = params.get('site'); - if (site != null && allowedRedirects.has(site)) { - window.open(allowedRedirects.get(site), '_blank'); - } - const navigate = useNavigate(); - navigate(-1); - return null; -}