Repository navigation
fix(garminauth): stop headless login on an error status from the signin page - #341
Merged
Merged
Conversation
Owner
Author
|
Independent verification: PASS+NOTES Head
Note: the test's |
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
A headless login failed with
CSRF token not found in HTMLwhile Garmin was refusing the sign-in page (#340). gccli never checked the status of that page, so it hid the real answer. The login now stops on any status other than 200 and names it.What changed
loginHeadlessreturnssso signin page returned <status> (title="<page title>")whenGET /sso/signinis not 200, before it parses the page.Scope
Blast Radius
Only
auth login --headlesswhen Garmin refuses the sign-in page. The exit code stays 1 and the--jsonerror code stayserror. Only the message changes. A successful login is unchanged.Verification
auth login --headlessagainst a local HTTPS mock that answers the sign-in page with 427, withHOMEandXDG_CONFIG_HOMEon temp directories. Base printedlogin: extract CSRF: CSRF token not found in HTML. Head printedlogin: sso signin page returned 427 (title="Access denied"). Both exit 1.TestLoginHeadless_SigninPageBlockedfails on the test commit and passes with the fix.make fmt-check,make lint,go vet -tags e2e ./...andmake testpass.Fixes #340.