Skip to content

feat(auth): end login on Voiceflow's own result page (COR-16309) - #53

Open
Bradenream wants to merge 1 commit into
masterfrom
braden/oauth2-result-page
Open

Bradenream wants to merge 1 commit into
masterfrom
braden/oauth2-result-page

Conversation

@Bradenream

@Bradenream Bradenream commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What

vf auth login sends the browser to the page named by authorization_result_uri in the sign-in server's metadata, once it knows how the login went. It gives codes only: the result, why it failed, whether it is this computer, what to do next, and the app to go back to. A server without the field leaves the CLI to show its own page, as now. The page is voiceflow/creator-app#24995 and the field is voiceflow/platform#4975.

Also fixes the order: the browser was told "Signed in" before the code was exchanged, so a refused code or a session that couldn't be stored still said it worked. The browser now waits for both.

How

  • resultpage.go: what happened, as the page's codes, and the address. Only https, or http on this computer.
  • callback.go: the callback waits for the login to end before it answers. Closing early answers it as failed.
  • An agent-driven login (OnAuthURL) says next=close; a person's says next=continue.
  • Over SSH it says neither "this computer" nor an editor to go back to.

Tested

  • go test -race ./internal/...
  • vf auth login through a real browser against the sign-in server's real code, with the test keychain: authorized, denied, a refused code, agent mode and inside Cursor each ended on the right page, and vf reported the same.
  • The Go check fails on master too, from 754023f: go vet rejects struct tags in the generated internal/sdk/models/components. internal/oauth passes go vet and its tests.

vf auth login sends the browser to authorization_result_uri from the
sign-in server's metadata once it knows how the login went, with codes
only. The browser now waits for the code exchange and the stored session
before it is told the result.
@linear-code

linear-code Bot commented Nov 26, 2026

Copy link
Copy Markdown

COR-16309

@Bradenream
Bradenream marked this pull request as ready for review November 26, 2026 00:09
Copilot AI balanced review requested due to automatic review settings November 26, 2026 00:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Reserved result parameters retain stale values when computed values are empty, and Claude detection bypasses SSH suppression of local application links.

2 open issues
What changed in this PR

This PR adds hosted login-result pages to vf auth login, using authorization-server metadata while retaining the CLI’s local page as a fallback.

Changes:

  • Waits for code exchange and session storage before reporting success to the browser.
  • Builds result-page URLs with outcome, agent-mode, and application-return codes.
  • Adds tests for hosted redirects, login failures, callback completion, and fallback behavior.
File Description
internal/​oauth/​resultpage.go Defines outcome codes, validates hosted URLs, and selects return-app hints.
internal/​oauth/​resultpage_test.go Tests result URLs, browser responses, failure reporting, and fallback pages.
internal/​oauth/​oauth.go Connects hosted pages to login and reports the final session-storage outcome.
internal/​oauth/​metadata.go Adds optional authorization_result_uri metadata.
internal/​oauth/​login_test.go Extends the fake server with result-page metadata and code-refusal support.
internal/​oauth/​callback.go Waits for login completion before answering successful callbacks and supports hosted redirects.

Review effort: Balanced

Comment on lines +110 to +112
if param[1] != "" {
query.Set(param[0], param[1])
}
Comment on lines +122 to +125
case getenv("CLAUDE_CODE_ENTRYPOINT") == "claude-desktop":
return "claude"
case getenv("SSH_CONNECTION") != "":
return "" // an editor's link opens it on the browser's computer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants