fix(oauth): add explicit routes for OAuth callbacks to prevent 301 redirects
Problem:
- Commit 96ab9b9 changed OAuth callbacks from .html files to directory structure
- Go's http.FileServer returns 301 redirect for /oauth/callback -> /oauth/callback/
- browser.identity.launchWebAuthFlow() rejects any HTTP redirects
- Result: Extension OAuth login fails with 'Authorization page could not be loaded'
Root Cause:
- FileServer requires trailing slash for directories (standard behavior)
- OAuth redirect URIs in client-metadata.json have no trailing slash
- Mismatch causes 301 redirect which breaks OAuth flow
Solution:
- Add explicit chi routes for /oauth/callback and /oauth/ff/callback
- Serve index.html directly without FileServer's redirect behavior
- Keeps directory structure organized while serving clean URLs
Testing:
- Local: curl http://localhost:8080/oauth/callback returns 200 (not 301)
- With query params: ?code=test&state=test returns 200 (not 301)
- Firefox callback: /oauth/ff/callback returns 200 (not 301)
Fixes:
- Chrome extension OAuth login
- Firefox extension OAuth login
- Maintains compatibility with existing redirect URIs