Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelkmpt committed Oct 15, 2024
1 parent ba988f1 commit a11b451
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// /Users/pawel/Dev/repos/ott-web-app/packages/ui-react/src/pages/RedirectToExternal/RedirectToExternal.tsx

import React, { useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
import { getOAuthConfig } from '@jwp/ott-hooks-react/src/useOAuth';

const RedirectToExternal: React.FC = () => {
const navigate = useNavigate();

useEffect(() => {
// Replace with your external URL
const externalUrl = 'https://cxl.com/institute/';

window.location.href = externalUrl;
}, [navigate]);

return null; // Render nothing
};

export default RedirectToExternal;
2 changes: 2 additions & 0 deletions platforms/web/src/containers/AppRoutes/AppRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {
} from '@jwp/ott-common/src/paths';

import useNotifications from '#src/hooks/useNotifications';
import RedirectToExternal from '@jwp/ott-ui-react/src/pages/RedirectToExternal/RedirectToExternal';

export default function AppRoutes() {
const location = useLocation();
Expand Down Expand Up @@ -92,6 +93,7 @@ export default function AppRoutes() {
element={<ErrorPage title={t('notfound_error_heading', 'Not found')} message={t('notfound_error_description', "This page doesn't exist.")} />}
/>
</Route>
<Route path="/cxl-sso" element={<RedirectToExternal />} />
</Routes>
);
}

0 comments on commit a11b451

Please sign in to comment.