Fix certificate View link (wrong /study/certificate URL), certificates in My Account, name on certificate; v2.10.10
Publish Container / build (push) Successful in 15m29s
Publish Container / build (push) Successful in 15m29s
- Certificate URLs in the account overview and the issuance email pointed at /study/certificate/:token, which the router treated as a lesson page; now /certificate/:token (old links redirect) - My Account Certificates card lists every enrolled study: progress, Generate, View, Copy link, Download PNG, Share - Certificate canvas used a non-existent /api/study-account route and always printed 'Student'; now reads the account name - Panel no longer collapses after generating Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
899e715067
commit
7301982bb1
8 files changed
+123
-30
No files matched your search
+8
-1
@@ -1,6 +1,6 @@
|
||||
import { useState, useEffect, useRef, useMemo } from 'react'
|
||||
import type { ReactElement } from 'react'
|
||||
import { Link, NavLink, Routes, Route, useLocation, useNavigate, useParams } from 'react-router-dom'
|
||||
import { Link, NavLink, Navigate, Routes, Route, useLocation, useNavigate, useParams } from 'react-router-dom'
|
||||
import AdminPage from './AdminPage'
|
||||
import QASection from './components/QASection'
|
||||
import ContactForm from './components/ContactForm'
|
||||
@@ -2956,6 +2956,12 @@ function LegalPage({ title, body }: { title: string; body: string[] }) {
|
||||
)
|
||||
}
|
||||
|
||||
// Certificate links emailed before v2.10.10 pointed at /study/certificate/:token.
|
||||
function LegacyCertificateRedirect() {
|
||||
const { token } = useParams<{ token: string }>()
|
||||
return <Navigate to={`/certificate/${encodeURIComponent(token ?? '')}`} replace />
|
||||
}
|
||||
|
||||
function PublicCertificatePage() {
|
||||
const { token } = useParams<{ token: string }>()
|
||||
const [cert, setCert] = useState<{ studyTitle: string; displayName: string; issuedAt: string } | null>(null)
|
||||
@@ -3536,6 +3542,7 @@ export default function App() {
|
||||
<Route path="/study/verify-email" element={<StudyRouteFrame content={content} child={<StudyVerifyEmailPage />} />} />
|
||||
<Route path="/study/account" element={<StudyRouteFrame content={content} child={<StudyAccountPage />} />} />
|
||||
<Route path="/study/discussion" element={<StudyRouteFrame content={content} child={<StudyDiscussionHubPage content={content} />} />} />
|
||||
<Route path="/study/certificate/:token" element={<LegacyCertificateRedirect />} />
|
||||
<Route path="/study/:studySlug" element={<StudyRouteFrame content={content} child={<ColossiansStudyIndexPage content={content} />} />} />
|
||||
<Route path="/study/:studySlug/community" element={<StudyRouteFrame content={content} child={<StudyCommunityPage content={content} />} />} />
|
||||
<Route path="/study/:studySlug/notes" element={<StudyRouteFrame content={content} child={<ColossiansStudyNotesPage content={content} />} />} />
|
||||
|
||||
Reference in new issue
Block a user