mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
fix(auth): make login footer legal links open real pages, not the login tab
The login-page footer linked to /offer, /privacy and /recurrent-payments with target=_blank, but none of those routes existed, so opening them hit the SPA catch-all, which redirects unauthenticated users to /login — every footer link just opened another login tab. - Add a public PublicLegal page that fetches the offer / privacy document from the existing public /cabinet/info endpoints and renders sanitized HTML (DOMPurify via the shared formatContent helper). - Register public /offer and /privacy routes. - Extract sanitizeHtml/formatContent into src/utils/legalContent.ts and reuse from Info.tsx (was duplicated). - Drop the /recurrent-payments footer link: there is no recurring-payments legal document or endpoint in the backend, so it had no real destination. Re-add once such a document exists. type-check, eslint, prettier and build all pass.
This commit is contained in:
@@ -42,6 +42,7 @@ import TelegramRedirect from './pages/TelegramRedirect';
|
||||
import DeepLinkRedirect from './pages/DeepLinkRedirect';
|
||||
import VerifyEmail from './pages/VerifyEmail';
|
||||
import ResetPassword from './pages/ResetPassword';
|
||||
import PublicLegal from './pages/PublicLegal';
|
||||
import OAuthCallback from './pages/OAuthCallback';
|
||||
|
||||
// Dashboard - load eagerly (default route, LCP-critical)
|
||||
@@ -266,6 +267,8 @@ function App() {
|
||||
<Route path="/auth/oauth/callback" element={<OAuthCallback />} />
|
||||
<Route path="/verify-email" element={<VerifyEmail />} />
|
||||
<Route path="/reset-password" element={<ResetPassword />} />
|
||||
<Route path="/offer" element={<PublicLegal doc="offer" />} />
|
||||
<Route path="/privacy" element={<PublicLegal doc="privacy" />} />
|
||||
<Route
|
||||
path="/merge/:mergeToken"
|
||||
element={
|
||||
|
||||
Reference in New Issue
Block a user