Repository navigation
fix(freemilk): finish Google login by pasting the redirect URL - #683
Merged
Merged
Conversation
The app's Google client only accepts its custom-scheme redirect, which no local listener can receive, and 127.0.0.1 is not the operator's browser when the console runs on a server. The login link now opens Google directly and CompleteLogin exchanges the pasted code with the pending PKCE verifier. Removes the unreachable scheme bridge and the failPending logic that marked an arbitrary pending login as failed. The wizard shows FreeMilk-specific paste instructions.
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.
Why
#681 sent the browser through a
127.0.0.1/launchpage and expected the Google redirect to come back to/oauth2callback. The redirect registered for the app's Google client is a custom scheme (com.googleusercontent.apps...:/oauth2callback), so the browser never reaches the loopback listener. On a server deployment127.0.0.1is not the operator's browser either. Polling therefore waited until the 10 minute timeout.What
StartLoginreturns the Google authorization URL directly (S256 PKCE, same client and redirect as the app).CompleteLogin: the operator pastes thecom.googleusercontent.apps...:/oauth2callback?code=...URL, the state must match the pending login, and the code is exchanged and stored on the account.PollLoginonly reports whether the pending login is still alive.auth.ServeSchemeBridge, the freemilk loopback listener, andfailPending(it marked an arbitrary pending login as failed).Checked against a Proxyman capture of the app's successful login
/tokenrequest parameters match./auth/googlefrom the app also carries an Appledevice_check_token; this change still omits it. A fake identity token gotInvalid Google identity token(not a DeviceCheck rejection), but a real token has not been tried. Needs production acceptance.Tests
go test ./...passes;tsc -bandnpm run syncclean.