mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
* fix: markdown files now default to rendered view and render properly - Add .md and .mdx MIME type support in backend (files.ts, defaults.ts) - Add key props to FilePreview components to force proper remounting when switching files - Fix markdown file detection with case-insensitive extension check - Reset markdownPreview state when file changes to ensure correct default view - Add onContentLoaded callback to VirtualizedTextView for reactive content updates - Add fullContent state to properly handle large markdown file rendering - Add error handling for async content loading to prevent blank screens - Reduce loading timeout from 50ms to 0ms for more responsive loading Fixes issues where: - Markdown files opened in raw view instead of rendered view - Large markdown files (12k+ lines) showed blank after loading completed - State persisted incorrectly when switching between different file types * Add directory download feature with ZIP archive support * Improve voice recording UX with loading states and better transcript handling * Fix auth config for prod/dev ports and add documentation Update AUTH_TRUSTED_ORIGINS and PASSKEY_ORIGIN to use backend port 5003 (frontend uses 5173 in dev). Add comprehensive auth documentation covering secrets, trusted origins, admin reset, and passkeys. Update README and add mkdocs config. * Remove roadmap section from README
3.9 KiB
3.9 KiB
OAuth Providers
Configure social login with OAuth providers.
Supported Providers
| Provider | Purpose |
|---|---|
| GitHub | Social login |
| Social login | |
| Discord | Social login |
GitHub OAuth
Create OAuth App
- Go to GitHub Developer Settings
- Click OAuth Apps > New OAuth App
- Fill in:
- Application name:
OpenCode Manager - Homepage URL:
http://localhost:5003 - Authorization callback URL:
http://localhost:5003/api/auth/callback/github
- Application name:
- Click Register application
- Copy Client ID
- Generate and copy Client Secret
Configure
GITHUB_CLIENT_ID=your-client-id
GITHUB_CLIENT_SECRET=your-client-secret
Callback URL
Adjust the callback URL for your environment:
| Environment | Callback URL |
|---|---|
| Local | http://localhost:5003/api/auth/callback/github |
| Production | https://yourdomain.com/api/auth/callback/github |
Google OAuth
Create OAuth Client
- Go to Google Cloud Console
- Create a new project or select existing
- Go to APIs & Services > Credentials
- Click Create Credentials > OAuth client ID
- Select Web application
- Configure:
- Name:
OpenCode Manager - Authorized redirect URIs:
http://localhost:5003/api/auth/callback/google
- Name:
- Click Create
- Copy Client ID and Client Secret
Configure
GOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-client-secret
Consent Screen
You may need to configure the OAuth consent screen:
- Go to APIs & Services > OAuth consent screen
- Select External (or Internal for Workspace)
- Fill in required fields
- Add scopes:
email,profile - Save
Discord OAuth
Create Application
- Go to Discord Developer Portal
- Click New Application
- Name it
OpenCode Manager - Go to OAuth2 section
- Add redirect:
http://localhost:5003/api/auth/callback/discord - Copy Client ID and Client Secret
Configure
DISCORD_CLIENT_ID=your-client-id
DISCORD_CLIENT_SECRET=your-client-secret
Using OAuth Login
Once configured:
- Go to the login page
- Click the provider button (GitHub, Google, Discord)
- Authorize in the popup
- You're logged in
First OAuth Login
On first OAuth login:
- Account is created automatically
- Email from provider is used
- No password is set (OAuth-only)
Linking Accounts
If you have an existing password account:
- Log in with password
- Go to Settings > Connected Accounts
- Click Connect for a provider
- Authorize the connection
Production Considerations
Update Callback URLs
Before deploying, update OAuth apps with production URLs:
https://yourdomain.com/api/auth/callback/github
https://yourdomain.com/api/auth/callback/google
https://yourdomain.com/api/auth/callback/discord
Verify Domains
Some providers require domain verification:
- Google requires verification for production
- Discord may require verification for many users
Secrets Management
- Never commit OAuth secrets to version control
- Use environment variables or secrets management
- Rotate secrets periodically
Troubleshooting
Redirect URI Mismatch
Error: "redirect_uri_mismatch" or similar
Solution:
- Check callback URL in provider settings
- Ensure exact match (including trailing slash)
- Verify protocol (http vs https)
- Check port number
Invalid Client
Error: "invalid_client" or "unauthorized_client"
Solution:
- Verify Client ID is correct
- Check Client Secret hasn't changed
- Ensure OAuth app is not suspended
Access Denied
Error: "access_denied" or user cancels
Solution:
- User may have denied permission
- Check required scopes are configured
- Verify consent screen is configured properly