Skip to content

Conversation

Siddhant-K-code
Copy link
Member

Summary

This PR implements a targeted redirect for non-authenticated Gitpod Classic PAYG users who visit gitpod.io with hash fragments (typically workspace creation URLs) to redirect them to app.ona.com instead.

How It Works

The redirect triggers when ALL of the following conditions are met:

  1. User is not authenticated (!user)
  2. On a Gitpod.io domain (isGitpodIo() returns true)
  3. On the root path (location.pathname === "/")
  4. Hash fragment is present (hash !== "")

When triggered, users are redirected from gitpod.io/#<context> to https://app.ona.com/#<context>

Scenarios Affected ✅

  • gitpod.io/#https://github.com/user/repoapp.ona.com/#https://github.com/user/repo
  • gitpod.io/#prebuild/https://github.com/user/repoapp.ona.com/#prebuild/https://github.com/user/repo
  • gitpod.io/#GITPOD_WORKSPACE_ID=xyz/https://github.com/user/repoapp.ona.com/#GITPOD_WORKSPACE_ID=xyz/https://github.com/user/repo
  • Any other workspace creation URLs with hash fragments

Scenarios NOT Affected ❌

  • Regular gitpod.io visitors: Users visiting gitpod.io/ without hash fragments see the normal login page
  • Authenticated users: Signed-in users continue using the dashboard normally, regardless of hash presence
  • Non-root paths: Users on /workspaces, /settings, etc. are unaffected
  • Enterprise installations: Only affects Gitpod.io (PAYG) domains
  • Other dashboard pages: /new, /login, etc. work normally

Edge Cases Considered

  1. Empty hash: gitpod.io/# (empty hash) → No redirect (normal login page)
  2. Loading states: Shows loading spinner during redirect to prevent flashing
  3. Hash preservation: Complex hashes with environment variables are fully preserved
  4. Domain variants: Works across all Gitpod.io domains (staging, dev environments)
  5. Quick start flow: /quickstart pages remain unaffected
  6. Direct navigation: Users can still directly access other dashboard routes
  7. Browser back/forward: Standard browser navigation behavior maintained

Testing Scenarios

  • Non-authenticated user visits gitpod.io/#https://github.com/test/repo → redirected to app.ona.com/#https://github.com/test/repo
  • Non-authenticated user visits gitpod.io/ → sees normal login page
  • Authenticated user visits gitpod.io/#https://github.com/test/repo → normal workspace creation flow
  • Enterprise user visits their instance → no redirect
  • User visits gitpod.io/settings → normal settings page

Risk Assessment: Low

  • Scope: Only affects non-authenticated users with hash fragments
  • Fallback: Users can still access regular login if needed
  • Reversible: Easy to disable if issues arise
  • Performance: Minimal impact, only checks conditions during app initialization

/hold

…to `app.ona.com/#`

Redirect non-signed-in Gitpod Classic PAYG users from `gitpod.io/#`(with hash fragments) to `app.ona.com/#` while preserving hash fragments. Only applies to users accessing workspace creation URLs, not regular gitpod.io visitors.
Copy link
Member

@filiptronicek filiptronicek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks great. Thank you for tackling this @Siddhant-K-code!

@Siddhant-K-code
Copy link
Member Author

/unhold

@roboquat roboquat merged commit d3c64b1 into main Sep 15, 2025
33 checks passed
@roboquat roboquat deleted the siddhant/gro-991-all-open-in-gitpod-buttons-on-github-and-browser-extensions branch September 15, 2025 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants