Skip to content

Unified auth dialog with token and sign-in modes#207

Merged
gnzjgo merged 9 commits intomainfrom
rmorehig/unified-auth-dialog
Feb 10, 2026
Merged

Unified auth dialog with token and sign-in modes#207
gnzjgo merged 9 commits intomainfrom
rmorehig/unified-auth-dialog

Conversation

@rmorehig
Copy link
Contributor

Summary

Consolidated authentication into a single AuthDialog component supporting both authenticated mode (username/password) and public mode (direct Tinybird token via URL params). Workspace information is fetched using the admin token before creating the scoped JWT, avoiding permission issues.

Changes

  • New unified AuthDialog component with tabbed interface for both auth modes
  • Updated useLogin hook to read credentials from URL search params
  • Updated useWorkspace hook to display workspace info from URL params
  • API routes now support token-based auth via X-Tinybird-Token and X-Tinybird-Host headers
  • Workspace name is fetched using admin token and passed as URL param to avoid JWT permission issues

🤖 Generated with Claude Code

rmorehig and others added 4 commits February 10, 2026 14:40
Create a consolidated AuthDialog component that supports both authenticated mode (username/password) and public mode (direct token via URL params). Workspace info is fetched using the admin token and passed in URL params to avoid permission issues with scoped JWTs. Updated authentication hooks to read credentials from URL params, and API routes to support both session auth and token-based auth via headers.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Feb 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
analytics-dashboard Ready Ready Preview, Comment Feb 10, 2026 4:11pm

The scoped JWT doesn't have permission to read /v1/workspace. Now the workspace name from URL params is also passed as X-Tinybird-Workspace header to the API, which uses it directly instead of trying to fetch.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add token/host header check in middleware to allow public mode requests
- Update /api/auth to return authenticated:true when token headers present
- Decode JWT to extract workspace name as fallback in /api/config
- Pass token/host headers when checking auth status in use-login
- Use devMode: false for token-based client to avoid branch mode

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@gnzjgo gnzjgo merged commit f41138f into main Feb 10, 2026
6 checks passed
@gnzjgo gnzjgo deleted the rmorehig/unified-auth-dialog branch February 10, 2026 16:28
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