Repository navigation
feat(auth): end login on Voiceflow's own result page (COR-16309) - #53
Open
Bradenream wants to merge 1 commit into
Open
Bradenream wants to merge 1 commit into
Bradenream wants to merge 1 commit into
Conversation
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.
There was a problem hiding this comment.
🟡 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What
vf auth loginsends the browser to the page named byauthorization_result_uriin 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.OnAuthURL) saysnext=close; a person's saysnext=continue.Tested
go test -race ./internal/...vf auth loginthrough 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, andvfreported the same.Gocheck fails onmastertoo, from 754023f:go vetrejects struct tags in the generatedinternal/sdk/models/components.internal/oauthpassesgo vetand its tests.