Files
app/package.json
Albert 6ff6bae270 feat: Implement OAuth with DPoP using @atproto/oauth-client-node
Replace manual OAuth implementation with official @atproto/oauth-client-node library to properly support DPoP (Demonstrating Proof of Possession) authentication.

Changes:
- Added @atproto/oauth-client-node dependency
- Created OAuth state store (SurrealDB-backed) for CSRF protection
- Created OAuth session store (SurrealDB-backed) for token persistence
- Created OAuth client singleton with localhost exception for development
- Rewrote /api/auth/login to use client.authorize()
- Rewrote /api/auth/callback to use client.callback() with DPoP
- Updated lib/auth/session.ts with getAuthenticatedAgent() for ATproto API calls
- Updated db/schema.surql with oauth_state and oauth_session tables
- Added scripts/apply-schema.js for database schema management
- Created plans/oauth-dpop-implementation.md with detailed implementation plan
- Removed legacy lib/auth/atproto.ts and lib/auth/oauth-state.ts
- Updated .env to use localhost exception (removed BLUESKY_CLIENT_ID)

The OAuth client now handles:
- PKCE code generation and verification
- DPoP proof generation and signing
- Automatic token refresh
- Session persistence across server restarts

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:40:04 +00:00

52 lines
1.3 KiB
JSON

{
"name": "ponderants",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"test": "npx magnitude"
},
"dependencies": {
"@ai-sdk/google": "latest",
"@ai-sdk/react": "latest",
"@atproto/api": "latest",
"@atproto/oauth-client-node": "^0.3.10",
"@deepgram/sdk": "latest",
"@google/generative-ai": "^0.24.1",
"@mantine/core": "latest",
"@mantine/form": "latest",
"@mantine/hooks": "latest",
"@react-three/drei": "latest",
"@react-three/fiber": "latest",
"@tabler/icons-react": "^3.35.0",
"ai": "latest",
"jsonwebtoken": "latest",
"next": "latest",
"openid-client": "latest",
"react": "latest",
"react-dom": "latest",
"surrealdb": "latest",
"three": "latest",
"umap-js": "latest",
"zod": "latest"
},
"devDependencies": {
"@types/jsonwebtoken": "latest",
"@types/node": "latest",
"@types/react": "latest",
"@types/react-dom": "latest",
"eslint": "latest",
"eslint-config-next": "latest",
"jiti": "^2.6.1",
"magnitude-test": "latest",
"playwright": "^1.56.1",
"postcss": "latest",
"postcss-preset-mantine": "latest",
"postcss-simple-vars": "latest",
"typescript": "latest"
}
}