Skip to content

Add a Mundane page that plays against the API with the Auth0 token - #97

Closed
shenanigansd wants to merge 2 commits into
mainfrom
mundane-page
Closed

shenanigansd wants to merge 2 commits into
mainfrom
mundane-page

Conversation

@shenanigansd

Copy link
Copy Markdown
Member

Requested by Brad · project thread

Before: logging in only showed your Auth0 profile on /account. Nothing used the token.

After: a new Mundane page in the nav lets a logged-in player start a game and play it hot-seat. The game id goes in the URL (?game=…), so reloading picks the game back up. Moves the API refuses show its reason inline.

This is the site half of end-to-end Auth0. The login now requests access tokens for the Mundane API audience, and src/lib/mundane.ts sends them as a bearer token to letsbuilda/mundane-backend#57.

How: the Auth0 client gets audience from PUBLIC_AUTH0_AUDIENCE, and a new getAccessToken() wraps getTokenSilently(). The page renders with textContent only, like /account. The new config is two public build variables, PUBLIC_AUTH0_AUDIENCE=https://mundane.letsbuilda.dev and PUBLIC_MUNDANE_API_URL=https://mundane.letsbuilda.dev. Add both to the Cloudflare build environment.

Before merging: create the Auth0 API (identifier https://mundane.letsbuilda.dev, RS256) and turn on Allow Offline Access, so refresh tokens work for it. Merge after mundane-backend#57 is deployed. Until then the page loads, but its API calls fail.

Checked: tsc and astro build pass, and Biome reports nothing new. The only error is the existing favicon a11y rule, which my newer local Biome flags. I couldn't click through a real Auth0 login from my sandbox. The API side was exercised separately on the Workers runtime.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AWtXV8CMUpAX8ktbGjgtJr


Generated by Claude Code

Logged-in players can start a Mundane game and play it hot-seat from
/mundane. Access tokens are now requested for the Mundane API audience and
sent as a bearer token on every call.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AWtXV8CMUpAX8ktbGjgtJr
@shenanigansd shenanigansd self-assigned this Oct 11, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
🔵 In progress
View logs
letsbuilda-dev 173792b Oct 11 2026, 03:14 PM

Biome's noSvgWithoutTitle rule fails CI on main too (and on the open
Dependabot PRs); the icon needs a <title> element.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AWtXV8CMUpAX8ktbGjgtJr
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.

2 participants