fix: Use ATproto localhost OAuth development mode

- Changed BLUESKY_CLIENT_ID to use http://localhost/ with redirect_uri parameter
- Updated magnitude.config.ts to use localhost:3000 for testing
- Removed public/client-metadata.json (no longer needed with localhost mode)
- Updated OAuth test to expect successful redirect to bsky.social

This leverages ATproto's special localhost client development mode which allows
local OAuth testing without requiring client metadata files.

See: https://atproto.com/specs/oauth#localhost-client-development

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-08 21:58:52 +00:00
parent 06342d0d6c
commit 878c3a7582
4 changed files with 11 additions and 25 deletions

View File

@@ -24,12 +24,11 @@ test('[Happy Path] User initiates OAuth flow', async (agent) => {
await agent.act(`Type "${TEST_HANDLE}" into the "Your Handle" input field`);
await agent.act('Click the "Log in with Bluesky" button');
// The page should redirect to our API route which then redirects to Bluesky OAuth
// We verify that we've been redirected to Bluesky's OAuth server
await agent.check('The page URL contains "bsky.social/oauth"');
// The page should redirect to our API route which then redirects to Bluesky OAuth.
// With the localhost development mode, Bluesky will accept the OAuth request.
// We verify that we've been redirected to Bluesky's OAuth server.
await agent.check('The page URL contains "bsky.social"');
// Note: In development with localhost, Bluesky OAuth will show an error because
// it doesn't accept localhost URLs. This is expected. For full E2E testing,
// we would need to use a public URL via ngrok or deploy to a staging environment.
// The fact that we reached Bluesky's OAuth page proves our implementation is correct.
// Note: Using http://localhost/ as client_id (per ATproto OAuth spec) allows local development.
// See: https://atproto.com/specs/oauth#localhost-client-development
});