Files
sor/Server/src/SOR.Website/Pages/Account/Index.cshtml
T
c972b8687e feat(website): stand up SOR.Website public game site
Adds the complete SOR.Website ASP.NET Core Razor Pages project:

Security architecture:
- SecurityHeadersMiddleware sets strict CSP (script-src/style-src 'self',
  form-action 'self', frame-ancestors 'none', object-src 'none')
  — all XSS injection is dead on arrival
- __Host- cookie prefix on session + CSRF cookies (forces Secure, Path=/,
  no Domain — prevents subdomain-compromise cookie theft)
- Anti-forgery tokens on every POST by default (Razor Pages default)
- AuthorizeFolder("/Account") — unauthenticated access to any /account/*
  redirected to login at the routing layer, no per-page [Authorize] needed
- Rate limiting per-IP: login (10/5min), register (5/hr), reset (3/15min)
- Open redirect prevention: all returnUrl values checked with Url.IsLocalUrl
- Anti-enumeration: ForgotPassword/Register never reveal whether email exists
- Account lockout: 5 failed login attempts → 30min lockout
- ChangePasswordAsync requires current password before accepting new one
- Leaderboard only projects DisplayName + RankScore (email/ID never exposed)
- Data Protection keys in Redis (shared key ring across pods)
- ForwardedHeaders middleware for accurate IP under TLS-terminating ingress

Pages implemented:
- Public: Home, Story, How To Play, Cards (catalog + detail), Leaderboard,
  AI Assets (explanation + report), News, Support, Privacy, Terms, Webclient
- Auth: Login, Register, Logout (POST-only), ForgotPassword, ResetPassword,
  VerifyEmail — all with rate limiting and anti-enumeration controls
- Account (auth-gated): Overview, Profile (display name), Security
  (change password), Game stats

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-04-22 19:51:04 -04:00

47 lines
1.7 KiB
Plaintext

@page
@model IndexModel
@{
ViewData["Title"] = "Account";
var account = Model.AccountData!;
}
<div class="page-header">
<div class="container">
<h1>@(account.DisplayName ?? "Channeler")</h1>
<p class="account-since">Channeler since @account.CreatedAt.ToString("MMMM yyyy")</p>
</div>
</div>
<div class="container account-layout">
<nav class="account-nav" aria-label="Account navigation">
<a href="/account" class="account-nav-link active">Overview</a>
<a href="/account/profile" class="account-nav-link">Profile</a>
<a href="/account/security" class="account-nav-link">Security</a>
<a href="/account/game" class="account-nav-link">Game Stats</a>
</nav>
<div class="account-content">
<div class="stat-grid">
<div class="stat-card">
<div class="stat-label">Rank Score</div>
<div class="stat-value">@account.RankScore</div>
</div>
<div class="stat-card">
<div class="stat-label">Email</div>
@* Email shown only to the authenticated owner — never to other players. *@
<div class="stat-value stat-email">@account.Email</div>
@if (!account.EmailConfirmed)
{
<span class="badge badge-warn">Unverified</span>
}
</div>
</div>
<div class="quick-actions">
<a href="/webclient" class="btn btn-primary">Enter Mindscape</a>
<a href="/account/profile" class="btn btn-ghost">Edit Profile</a>
<a href="/account/security" class="btn btn-ghost">Security</a>
</div>
</div>
</div>