Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- POST /admin/users/:id/reset-password with bcrypt hash - KeyRound button in user list (disabled for own account) - Modal with password field (min 8 chars) and confirmation - resetPassword() added to apiClient.admin Closes #173 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- serve.sh staging: build frontend + start Express :3002 + nginx :8080 - serve.sh staging-stop / staging-status - .env.staging template (gitignored) - Mirrors production config: NODE_ENV=production, nginx proxy, PM2-like Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
./serve.sh staging now fetches origin/develop and runs from /tmp/riftline-staging — always reflects the real develop state, not local uncommitted changes. Worktree cleaned up on staging-stop. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…redentials - POST /players/sync falls back to stored predgg_refresh_token when no user OAuth token (allows MANAGER/COACH/PLAYER to refresh player profiles) - Refresh button shown for internalAuthenticated (any logged-in user) instead of authenticated (pred.gg OAuth only) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When a player profile is opened and has no snapshot data (generalStats empty), automatically triggers the same sync as the Refresh button. User sees data appear without having to click anything. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
POST /players/sync now: 1. Syncs player profile and creates snapshot (immediate, blocking) 2. Syncs recent matches + event stream in background (non-blocking) After clicking Refresh on a player profile, all new matches and their timeline/analysis data appear automatically within seconds. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5a19e57df0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!userToken) { | ||
| try { | ||
| const cred = await db.platformCredential.findUnique({ where: { key: 'predgg_refresh_token' } }); | ||
| if (cred) { | ||
| const result = await exchangeToken({ grant_type: 'refresh_token', refresh_token: cred.value }); | ||
| if (result.ok && result.data.access_token) userToken = result.data.access_token; |
There was a problem hiding this comment.
Require auth before using platform sync token
Because /players/sync is still registered without requireAuth, this fallback lets any unauthenticated caller exchange the stored predgg_refresh_token and run player + recent-match syncs against the database. The rest of the app mounts playersRouter directly (apps/api/src/index.ts) with no global auth, so a public POST can now consume the platform credential/quota and write arbitrary synced players; gate this fallback/route behind internal auth or admin authorization before reading the stored credential.
Useful? React with 👍 / 👎.
| "$STAGING_DIR/node_modules/.bin/tsx" "$STAGING_DIR/apps/api/src/index.ts" \ | ||
| >> "$STAGING_LOG" 2>&1 & |
There was a problem hiding this comment.
Pass staging env values when launching the API
The staging command advertises API :3002 and a production-like built frontend, but this launch relies on .env.staging to provide PORT and NODE_ENV; copying from .env.example leaves both unset. In that common setup the API uses its default process.env.PORT ?? '3001' (apps/api/src/index.ts:41) and skips the production static serving//api rewrite, so wait_for_port 3002 fails or staging serves the wrong mode. Prefix the command with PORT=$STAGING_API_PORT NODE_ENV=production (or export them explicitly) instead of relying on hidden env file keys.
Useful? React with 👍 / 👎.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…precise check - Remove internalAuthenticated check (race condition with async auth state) - Check typeof matches === 'number' instead of Object.keys empty check (handles partial snapshots with favRole/favHero but missing numeric stats) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… missing When no snapshot exists or snapshot has no match data, calculate MATCHES, WIN RATE, KDA and HERO DAMAGE directly from the MatchPlayer records already loaded for the profile. This works without pred.gg API call and shows data immediately on first load. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace IIFE with explicit variable computed before the return statement.
The IIFE was silently returning {} despite matchPlayers being available.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ing start - Compute generalStats as explicit variable before return (IIFE had tsx cache issue) - Clear ~/.cache/tsx on each staging start to ensure latest code runs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
BUG-001: generalStats empty (tsx cache + IIFE issue) BUG-002: staging serving old code (tsx cache) BUG-003: upgrade-insecure-requests blocks fetch on HTTP BUG-004: secure cookies rejected over HTTP Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sprint PR — Sprint 2
Cambios incluidos
Player Scouting
Platform Admin
Infraestructura
./serve.sh staging— nginx + build real desde ramadevelopOrganización
future_features_roadmap.mdeliminado (GitHub es la fuente de verdad)mainydevelopTesting
Issue de testing se creará automáticamente al abrir este PR.
🤖 Generated with Claude Code