Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Fix URL for staging stack (#7030)

chuckbutkus5378932017d4
diff --git a/frontend/src/utils/generate-github-auth-url.ts b/frontend/src/utils/generate-github-auth-url.ts
index ed2fa38f41..082376ccbd 100644
--- a/frontend/src/utils/generate-github-auth-url.ts
+++ b/frontend/src/utils/generate-github-auth-url.ts
@@ -10,7 +10,7 @@ export const generateGitHubAuthUrl = (clientId: string, requestUrl: URL) => {
.replace("https://", "")
.replace("http://", "");
const authUrl = baseUrl
- .replace(/(^|\.)staging\.all-hands\.dev$/, ".auth.staging.all-hands.dev")
+ .replace(/(^|\.)staging\.all-hands\.dev$/, "$1auth.staging.all-hands.dev")
.replace(/(^|\.)app\.all-hands\.dev$/, "auth.app.all-hands.dev");
const scope = "openid email profile";
return `https://${authUrl}/realms/allhands/protocol/openid-connect/auth?client_id=github&response_type=code&redirect_uri=${encodeURIComponent(redirectUri)}&scope=${encodeURIComponent(scope)}`;