Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions src/core/webview/webviewMessageHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2251,6 +2251,48 @@ export const webviewMessageHandler = async (

break
}
case "rooCloudManualUrl": {
try {
if (!message.text) {
vscode.window.showErrorMessage(t("common:errors.manual_url_empty"))
break
}

// Parse the callback URL to extract parameters
const callbackUrl = message.text.trim()
const uri = vscode.Uri.parse(callbackUrl)

if (!uri.query) {
throw new Error(t("common:errors.manual_url_no_query"))
}

const query = new URLSearchParams(uri.query)
const code = query.get("code")
const state = query.get("state")
const organizationId = query.get("organizationId")

if (!code || !state) {
throw new Error(t("common:errors.manual_url_missing_params"))
}

// Reuse the existing authentication flow
await CloudService.instance.handleAuthCallback(
code,
state,
organizationId === "null" ? null : organizationId,
)

await provider.postStateToWebview()
} catch (error) {
provider.log(`ManualUrl#handleAuthCallback failed: ${error}`)
const errorMessage = error instanceof Error ? error.message : t("common:errors.manual_url_auth_failed")

// Show error message through VS Code UI
vscode.window.showErrorMessage(`${t("common:errors.manual_url_auth_error")}: ${errorMessage}`)
}

break
}

case "saveCodeIndexSettingsAtomic": {
if (!message.codeIndexSettings) {
Expand Down
10 changes: 10 additions & 0 deletions src/i18n/locales/ca/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion src/i18n/locales/de/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion src/i18n/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,12 @@
},
"api": {
"invalidKeyInvalidChars": "API key contains invalid characters."
}
},
"manual_url_empty": "Please enter a valid callback URL",
"manual_url_no_query": "Invalid callback URL: missing query parameters",
"manual_url_missing_params": "Invalid callback URL: missing required parameters (code and state)",
"manual_url_auth_failed": "Manual URL authentication failed",
"manual_url_auth_error": "Authentication failed"
},
"warnings": {
"no_terminal_content": "No terminal content selected",
Expand Down
7 changes: 6 additions & 1 deletion src/i18n/locales/es/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion src/i18n/locales/fr/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion src/i18n/locales/hi/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion src/i18n/locales/id/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion src/i18n/locales/it/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion src/i18n/locales/ja/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion src/i18n/locales/ko/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion src/i18n/locales/nl/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion src/i18n/locales/pl/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion src/i18n/locales/pt-BR/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion src/i18n/locales/ru/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading