Skip to content

Add /setup page and block data loading until GitHub App is authorized#72

Merged
stylessh merged 1 commit intomainfrom
stylessh/fix-pr-details-crash
Apr 11, 2026
Merged

Add /setup page and block data loading until GitHub App is authorized#72
stylessh merged 1 commit intomainfrom
stylessh/fix-pr-details-crash

Conversation

@stylessh
Copy link
Copy Markdown
Owner

Summary

  • Adds a dedicated /setup route that loads GitHub access state server-side and lets users authorize the app and install it on their accounts/orgs before entering the dashboard.
  • Guards all protected routes with a lightweight checkSetupComplete DB check — redirects to /setup if the user hasn't authorized the GitHub App yet, preventing data fetching with missing tokens.
  • Hardens getGitHubContext() with try/catch around getGitHubClientByUserId to prevent Worker crashes when OAuth tokens are missing or expired.
  • Removes auto-open onboarding dialog logic from DashboardLayout and GitHubAccessDialog since /setup now handles first-time setup.

Test plan

  • Fresh login redirects to /setup instead of dashboard
  • /setup shows account/org installation status without a loading flash
  • Authorizing and installing the app on GitHub redirects back to /setup
  • "Go to dashboard" CTA appears once at least one installation is detected
  • "Install on GitHub" CTA is hidden when all accounts/orgs are installed
  • /setup is accessible after setup for managing access
  • Existing users with completed setup go straight to dashboard

…ized (#72)

Prevent data loading before users complete GitHub App setup by redirecting
from protected routes to a dedicated /setup page. Also hardens getGitHubContext
with try/catch to avoid Worker crashes from missing OAuth tokens.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
diffkit 5b95f44 Commit Preview URL

Branch Preview URL
Apr 11 2026, 10:18 PM

@stylessh stylessh merged commit 91ebd0a into main Apr 11, 2026
4 checks passed
stylessh added a commit that referenced this pull request Apr 18, 2026
…ized (#72) (#72)

Prevent data loading before users complete GitHub App setup by redirecting
from protected routes to a dedicated /setup page. Also hardens getGitHubContext
with try/catch to avoid Worker crashes from missing OAuth tokens.
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.

1 participant