Repository navigation
Ignore corrupt refresh token file instead of failing authentication (#268) - #974
Open
omaraldulimay wants to merge 1 commit into
Open
omaraldulimay wants to merge 1 commit into
omaraldulimay wants to merge 1 commit into
Conversation
…pen-EO#268) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Fixes #268
What changed
RefreshTokenStore.get_refresh_token()now logs a warning and returnsNonewhen the refresh token file is corrupt, soauthenticate_oidc()falls back to the device code flow instead of crashing.RefreshTokenStore.set_refresh_token()now logs a warning and starts from an empty dict when the file is corrupt, so the new refresh token overwrites the broken file.PrivateJsonFile.load()andAuthConfigare unchanged.Tests
tests/rest/auth/test_config.pyforget_refresh_tokenandset_refresh_tokenwith a corrupt file (including warning checks).tests/rest/test_connection.py: with a corrupt refresh token file,authenticate_oidc()falls back to the device flow and stores the new refresh token.pytest tests/rest/auth tests/rest/test_connection.py: 512 passed.This PR was drafted with the help of Claude Code.