Skip to content

Commit d3c64b1

Browse files
feat(dashboard): redirect non-authenticated users from gitpod.io/# to app.ona.com/# (#21054)
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.
1 parent a351fe1 commit d3c64b1

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

components/dashboard/src/App.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { LinkedInCallback } from "react-linkedin-login-oauth2";
1818
import { useQueryParams } from "./hooks/use-query-params";
1919
import { useTheme } from "./theme-context";
2020
import QuickStart from "./components/QuickStart";
21+
import { isGitpodIo, getURLHash } from "./utils";
2122

2223
export const StartWorkspaceModalKeyBinding = `${/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform) ? "⌘" : "Ctrl﹢"}O`;
2324

@@ -64,6 +65,15 @@ const App: FC = () => {
6465
return <AppLoading />;
6566
}
6667

68+
// Redirect non-signed-in Gitpod Classic PAYG users from gitpod.io/# to app.ona.com/#
69+
const hash = getURLHash();
70+
if (!user && isGitpodIo() && location.pathname === "/" && hash !== "") {
71+
// Preserve the hash fragment when redirecting
72+
const hashFragment = window.location.hash;
73+
window.location.href = `https://app.ona.com/${hashFragment}`;
74+
return <AppLoading />; // Show loading while redirecting
75+
}
76+
6777
// Technically this should get handled in the QueryErrorBoundary, but having it here doesn't hurt
6878
// At this point if there's no user, they should Login
6979
if (!user) {

memory-bank/activeContext.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Building a comprehensive knowledge base of the Gitpod codebase and architecture
1919
- Enhanced API component documentation with code generation information
2020
- Implemented server readiness probe with database, SpiceDB, and Redis connectivity checks
2121
- **Improved `registry-facade` resilience by implementing a comprehensive retry mechanism for blob retrieval, addressing transient network errors.**
22+
- **Implemented redirect for non-signed-in Gitpod Classic PAYG users from `gitpod.io/#` (with hash fragments) to `app.ona.com/#`, preserving hash fragments. Only applies to users with hash fragments, not all gitpod.io visitors.**
2223

2324
## Next Steps
2425

memory-bank/components/dashboard.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ The Dashboard provides interfaces for:
6565
- IDE preferences
6666
- Feature preview settings
6767

68+
4. **Redirection Logic**:
69+
- Redirects non-signed-in Gitpod Classic PAYG users from `gitpod.io/#` to `app.ona.com/#`
70+
- Only triggers when a hash fragment is present (`hash !== ""`)
71+
- Preserves hash fragments during the redirect
72+
- Only applies to the root path (`/`) on gitpod.io domains
73+
- Does NOT redirect users visiting `gitpod.io/` without hash fragments
74+
6875
## Development Workflow
6976

7077
The Dashboard supports several development workflows:

0 commit comments

Comments
 (0)