Skip to content

Commit d059c2a

Browse files
iQQBotona-agent
andcommitted
docs: update domain examples to use gitpod.io instead of preview domains
Update test examples and documentation to use production-appropriate domain examples (gitpod.io) instead of specific preview environment domains for better clarity and maintainability. Co-authored-by: Ona <[email protected]>
1 parent bd2f098 commit d059c2a

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

components/server/src/auth/api-subdomain-redirect.spec.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ describe("API Subdomain Redirect Logic", () => {
1414

1515
describe("isApiSubdomainOfConfiguredHost", () => {
1616
it("should detect api subdomain of configured host", () => {
17-
const configuredHost = "pd-nonce.preview.gitpod-dev.com";
17+
const configuredHost = "gitpod.io";
1818
const testCases = [
19-
{ hostname: "api.pd-nonce.preview.gitpod-dev.com", expected: true },
20-
{ hostname: "api.gitpod.io", expected: false }, // Different configured host
21-
{ hostname: "pd-nonce.preview.gitpod-dev.com", expected: false }, // Main domain
22-
{ hostname: "workspace-123.pd-nonce.preview.gitpod-dev.com", expected: false }, // Other subdomain
19+
{ hostname: "api.gitpod.io", expected: true },
20+
{ hostname: "api.preview.gitpod-dev.com", expected: false }, // Different configured host
21+
{ hostname: "gitpod.io", expected: false }, // Main domain
22+
{ hostname: "workspace-123.gitpod.io", expected: false }, // Other subdomain
2323
{ hostname: "api.evil.com", expected: false }, // Different domain
2424
];
2525

@@ -39,7 +39,7 @@ describe("API Subdomain Redirect Logic", () => {
3939
});
4040

4141
it("should handle preview environment correctly", () => {
42-
const configuredHost = "pd-nonce.preview.gitpod-dev.com";
42+
const configuredHost = "preview.gitpod-dev.com";
4343
const apiSubdomain = `api.${configuredHost}`;
4444

4545
const result = isApiSubdomainOfConfiguredHost(apiSubdomain, configuredHost);
@@ -52,20 +52,20 @@ describe("API Subdomain Redirect Logic", () => {
5252
const scenarios = [
5353
{
5454
name: "GitHub OAuth Callback on API Subdomain",
55-
hostname: "api.pd-nonce.preview.gitpod-dev.com",
56-
configuredHost: "pd-nonce.preview.gitpod-dev.com",
55+
hostname: "api.gitpod.io",
56+
configuredHost: "gitpod.io",
5757
shouldRedirect: true,
5858
},
5959
{
6060
name: "Regular Login on Main Domain",
61-
hostname: "pd-nonce.preview.gitpod-dev.com",
62-
configuredHost: "pd-nonce.preview.gitpod-dev.com",
61+
hostname: "gitpod.io",
62+
configuredHost: "gitpod.io",
6363
shouldRedirect: false,
6464
},
6565
{
6666
name: "Workspace Port (Should Not Redirect)",
67-
hostname: "3000-pd-nonce.preview.gitpod-dev.com",
68-
configuredHost: "pd-nonce.preview.gitpod-dev.com",
67+
hostname: "3000-gitpod.io",
68+
configuredHost: "gitpod.io",
6969
shouldRedirect: false,
7070
},
7171
];

components/server/src/auth/nonce-service.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export class NonceService {
3232
secure: this.config.auth.session.cookie.secure,
3333
sameSite: "strict", // Strict for CSRF protection
3434
maxAge: 5 * 60 * 1000, // 5 minutes (same as JWT state expiry)
35-
path: "/auth", // Limit to auth paths only
3635
});
3736
}
3837

0 commit comments

Comments
 (0)