Apple design (plans/gtm/APPLE-DESIGN-RULES-2026-11-17.md): rewrote theme tokens in globals.css/tailwind.config.js to neutral black/white + one accent (#0071E3), replacing the GitHub-dark blue+green dual-accent theme; mechanically swept every raw inline hex/rgba literal across app/components that bypassed the CSS vars (506 hex + 326 rgb(a) replacements) since most of the app hardcoded colors rather than using tokens; removed all emoji, decorative gradients (Tailwind bg-gradient-to-* and raw linear/radial- gradient() in inline styles), confetti, and glow/blur decorative orbs; converted Navbar/Navigation to icon-only with aria-label+title. Finished two stopped agents' in-progress work: deleted the fake AnimatedStats/ LiveActivity/ProjectShowcase/Testimonials auth-panel components and cleaned up the emoji-laden feature list in (auth)/layout.tsx. Removed remaining fabricated stats (topics/topics/[slug] posts-per-week/ contributors/followers) per the no-fake-numbers rule. Rithub sign-in: added "Continue with Rithub" as an icon-only OAuth2 button (RithubMark component) on login/register, hidden "Continue with GitHub" when GITHUB_CLIENT_ID is unset (confirmed unset in prod). Backend: authenticateWithGitea in oauthService.ts exchanges the Gitea OAuth2 code, resolves identity via the existing ForgeConnection table (no schema migration needed), issues the same JWT/session as GitHub/Google login. OAuth2 app created live on rithub.dev via its REST API as admin user caelum0x; client id/secret stored in railyard-box's compose file (env files don't ship to the runtime image, so the actual wiring lives in docker-compose.yml, not backend/.env) and in ~/products/.env. Critical bug found and fixed while verifying: services/api.ts's global 401 interceptor redirected every anonymous visitor to /login a couple seconds after ANY page load -- including /login and /register themselves -- because the AuthBootstrap's background GET /auth/me (expected to 401 for signed-out visitors) was treated the same as a real session-expiry 401, triggering a refresh attempt, another 401, and a hard window.location.href redirect, which re-ran AuthBootstrap and repeated. Fixed by excluding /auth/me and /auth/refresh from that redirect path. Verified live with a fresh, cookie-less browser: previously looped /register -> /login forever; now stable after 6s. Also fixed: production CORS/API origin mismatch -- the frontend was built with NEXT_PUBLIC_API_URL pointing at ritgram.ereboslab.com while served from ritgram.rithub.dev, so every API call (login, register, etc.) was blocked by CORS; rebuilt with rithub.dev as canonical and CORS_ORIGIN allowing both domains. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
62 lines
2.5 KiB
TypeScript
62 lines
2.5 KiB
TypeScript
'use client'
|
|
import Link from 'next/link'
|
|
import { useEffect } from 'react'
|
|
import { useAuthStore } from '@/store/authStore'
|
|
import { useRouter } from 'next/navigation'
|
|
|
|
export default function SettingsPage() {
|
|
const router = useRouter()
|
|
const { isAuthenticated, logout } = useAuthStore()
|
|
useEffect(() => {
|
|
if (!isAuthenticated) router.replace('/login')
|
|
}, [isAuthenticated, router])
|
|
|
|
if (!isAuthenticated) return null
|
|
|
|
const handleLogout = async () => {
|
|
await logout()
|
|
router.push('/')
|
|
}
|
|
|
|
const sections = [
|
|
{ title: 'Account', href: '/settings/account', icon: '', desc: 'Name, email, username, password' },
|
|
{ title: 'Privacy', href: '/settings/privacy', icon: '', desc: 'Visibility, DMs, data export, 2FA' },
|
|
{ title: 'Notifications', href: '/settings/notifications', icon: '', desc: 'Push, email, quiet hours' },
|
|
{ title: 'Appearance', href: '/settings/appearance', icon: '', desc: 'Theme, font size, language, density' },
|
|
{ title: 'Security', href: '/settings/security', icon: '', desc: 'Sessions, login history, 2FA' },
|
|
{ title: 'Blocked Users', href: '/settings/blocked', icon: '', desc: 'Manage blocked accounts' },
|
|
{ title: 'Moderation', href: '/settings/moderation', icon: '', desc: 'Muted words, accounts, and threads' },
|
|
{ title: 'Language', href: '/settings/language', icon: '', desc: 'Display language and region' },
|
|
{ title: 'Data & Storage', href: '/settings/data', icon: '', desc: 'Cache, downloads, data export' },
|
|
{ title: 'Subscription', href: '/settings/subscription', icon: '', desc: 'Plan, billing, premium features' },
|
|
{ title: 'Preferences', href: '/settings/preferences', icon: '', desc: 'Accessibility, autoplay, content' },
|
|
]
|
|
|
|
return (
|
|
<div className="max-w-2xl mx-auto py-8 px-4">
|
|
<h1 className="text-3xl font-bold mb-8">Settings</h1>
|
|
<div className="space-y-2">
|
|
{sections.map(s => (
|
|
<Link key={s.href} href={s.href} className="flex items-center gap-4 p-4 bg-card border border-border rounded-lg hover:bg-muted/50 transition-colors">
|
|
<span className="text-2xl w-9 text-center flex-shrink-0">{s.icon}</span>
|
|
<div className="min-w-0">
|
|
<span className="block font-semibold text-foreground">{s.title}</span>
|
|
<span className="block text-sm text-foreground/50 truncate">{s.desc}</span>
|
|
</div>
|
|
<span className="ml-auto text-foreground/30 flex-shrink-0">›</span>
|
|
</Link>
|
|
))}
|
|
</div>
|
|
|
|
<div className="mt-8 pt-8 border-t border-border">
|
|
<button
|
|
onClick={handleLogout}
|
|
className="w-full py-3 bg-error text-white rounded-lg hover:bg-error/90 font-semibold"
|
|
>
|
|
Log Out
|
|
</button>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|