Skip to content

Staging → Main: Profile seeding on sign-in + OTP screen readability fix - #8

Merged
holkexyz merged 2 commits into
mainfrom
staging
Mar 11, 2026
Merged

Staging → Main: Profile seeding on sign-in + OTP screen readability fix#8
holkexyz merged 2 commits into
mainfrom
staging

Conversation

@holkexyz

@holkexyz holkexyz commented Mar 11, 2026

Copy link
Copy Markdown
Member

Summary

  • Seed empty profile records on sign-in — On every OAuth callback, check if app.certified.actor.profile and app.bsky.actor.profile "self" records exist; if not, create empty ones with createdAt. Best-effort (wrapped in try/catch, won't break sign-in).
  • Fix OTP login screen readability — Swap brand_color to navy (#0F2544) and background_color to white (#FFFFFF). The previous dark navy background made the ePDS's internally-derived body text nearly unreadable.

Changes

  • src/app/api/auth/callback-handler/route.ts — Added ensureProfileRecords() helper called after session creation
  • src/app/.well-known/oauth-client-metadata/route.ts — Flipped brand_color and background_color values

Summary by CodeRabbit

  • New Features

    • Sign-in process now automatically initializes user profile records upon authentication.
  • Style

    • Updated OAuth client metadata colors (brand and background).

@vercel

vercel Bot commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
certified-app Ready Ready Preview, Comment Mar 11, 2026 0:42am

Request Review

@coderabbitai

coderabbitai Bot commented Mar 11, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: 86113d4b-8bfc-401a-b0b0-09ed368db10a

📥 Commits

Reviewing files that changed from the base of the PR and between 21af558 and ec8f99b.

📒 Files selected for processing (2)
  • src/app/.well-known/oauth-client-metadata/route.ts
  • src/app/api/auth/callback-handler/route.ts

📝 Walkthrough

Walkthrough

Two changes were made: OAuth client metadata colors were swapped to update visual branding, and a post-sign-in profile seeding mechanism was introduced to automatically create "self" records in specified collections after authentication.

Changes

Cohort / File(s) Summary
OAuth Metadata
src/app/.well-known/oauth-client-metadata/route.ts
Swapped brand_color and background_color values: brand_color now #0F2544, background_color now #FFFFFF.
Auth Callback Handler
src/app/api/auth/callback-handler/route.ts
Added post-sign-in seeding logic: defines PROFILE_COLLECTIONS and ensureProfileRecords function to check and create "self" records via AT Protocol repo API after session creation; errors are silently ignored.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Handler as Callback Handler
    participant Session as Session Management
    participant OAuth as OAuth Restoration
    participant Agent as Agent Instance
    participant ATP as AT Protocol API
    
    Client->>Handler: GET /callback (with auth code)
    Handler->>Session: Create session
    Session-->>Handler: Session created
    Handler->>OAuth: Restore OAuth session
    OAuth-->>Handler: Session restored
    Handler->>Agent: Instantiate Agent
    Agent-->>Handler: Agent ready
    Handler->>ATP: ensureProfileRecords (for each collection)
    Note over ATP: Check for "self" record<br/>Create if missing
    ATP-->>Handler: Records ensured (or silently fail)
    Handler-->>Client: Sign-in complete
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰✨ Colors dance in a brand new dress,
While profiles sprout with nary a mess—
Post-sign-in seeds we gently sow,
Self-records bloom where users flow! 🌱


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@holkexyz
holkexyz merged commit 4aa3dbf into main Mar 11, 2026
3 checks passed
hb-agent pushed a commit that referenced this pull request May 18, 2026
…Error

AGENTS.md §17 #7 and §24 #8 both state explicitly that "4xx errors
*can* echo upstream messages — those are usually validation a user
can act on." The helper, however, was returning generic strings
("Bad request" / "Forbidden" / etc.) for every status, so every
route using it surfaced opaque errors that masked actionable upstream
detail. A user submitting an invalid group handle, for example, got
"Bad request" instead of the upstream's "Handle must be at least 3
characters". The XRPC proxy already did the right thing (xrpc/route
echoes for 4xx, generic for 5xx); this brings the shared helper in
line with the documented policy and the XRPC proxy precedent.

Also: clamp the upstream-supplied status to the valid HTTP range
(200..599). The function previously trusted any integer on
`err.status` / `err.statusCode`, which would pass through to
NextResponse — caches and browsers handle non-standard codes
inconsistently. Anything outside the valid range now collapses to
500.

5xx behavior is unchanged: still generic message, still logged.
Echoed 4xx messages pass through a redactSecrets pass that strips
Bearer tokens, DPoP material, and bare JWTs that the atproto SDK
occasionally embeds in error messages.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant