Skip to content

Commit

Permalink
fix: add authenticatedpageroute so learner can create a shared record…
Browse files Browse the repository at this point in the history
… link (#187)

* fix: add authenticatedpageroute so learner can create a shared record link and be redirected to login when no longer authenticated

---------

Co-authored-by: Jason Wesson <[email protected]>
  • Loading branch information
jsnwesson and jsnwesson authored Sep 29, 2023
1 parent 944cbde commit 2bcbd6a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Routes, Route } from 'react-router-dom';
import {
APP_INIT_ERROR, APP_READY, subscribe, initialize, mergeConfig, getConfig,
} from '@edx/frontend-platform';
import { AppProvider, ErrorPage } from '@edx/frontend-platform/react';
import { AppProvider, ErrorPage, AuthenticatedPageRoute } from '@edx/frontend-platform/react';
import { HelmetProvider } from 'react-helmet-async';
import Header from '@edx/frontend-component-header';
import Footer from '@edx/frontend-component-footer';
Expand All @@ -29,12 +29,12 @@ subscribe(APP_READY, () => {
<Routes>
<Route
path={ROUTES.PROGRAM_RECORDS}
element={<ProgramRecordsList />}
element={<AuthenticatedPageRoute><ProgramRecordsList /></AuthenticatedPageRoute>}
/>
{getConfig().ENABLE_VERIFIABLE_CREDENTIALS && (
<Route
path={ROUTES.VERIFIABLE_CREDENTIALS}
element={<ProgramCertificatesList />}
element={<AuthenticatedPageRoute><ProgramCertificatesList /></AuthenticatedPageRoute>}
/>
)}
<Route
Expand All @@ -43,7 +43,7 @@ subscribe(APP_READY, () => {
/>
<Route
path={ROUTES.PROGRAM_RECORD_ITEM}
element={<ProgramRecord isPublic={false} />}
element={<AuthenticatedPageRoute><ProgramRecord isPublic={false} /></AuthenticatedPageRoute>}
/>
</Routes>
) : (
Expand Down

0 comments on commit 2bcbd6a

Please sign in to comment.