Redirect non-authenticated users from gitpod.io/#
to app.ona.com/#
for workspace creation
#21054
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 toapp.ona.com
instead.How It Works
The redirect triggers when ALL of the following conditions are met:
!user
)isGitpodIo()
returns true)location.pathname === "/"
)hash !== ""
)When triggered, users are redirected from
gitpod.io/#<context>
tohttps://app.ona.com/#<context>
Scenarios Affected ✅
gitpod.io/#https://github.com/user/repo
→app.ona.com/#https://github.com/user/repo
gitpod.io/#prebuild/https://github.com/user/repo
→app.ona.com/#prebuild/https://github.com/user/repo
gitpod.io/#GITPOD_WORKSPACE_ID=xyz/https://github.com/user/repo
→app.ona.com/#GITPOD_WORKSPACE_ID=xyz/https://github.com/user/repo
Scenarios NOT Affected ❌
gitpod.io/
without hash fragments see the normal login page/workspaces
,/settings
, etc. are unaffected/new
,/login
, etc. work normallyEdge Cases Considered
gitpod.io/#
(empty hash) → No redirect (normal login page)/quickstart
pages remain unaffectedTesting Scenarios
gitpod.io/#https://github.com/test/repo
→ redirected toapp.ona.com/#https://github.com/test/repo
gitpod.io/
→ sees normal login pagegitpod.io/#https://github.com/test/repo
→ normal workspace creation flowgitpod.io/settings
→ normal settings pageRisk Assessment: Low
/hold