Repository navigation
fix: flagsmith init fails with invalid_grant on an expired session - #110
Conversation
📝 Walkthrough
Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: ASSERTIVE
- Plan: Advanced
- Run ID:
40dd1550-a868-4a30-95c0-e1257cfde444
📒 Files selected for processing: 4
internal/auth/oauth.gointernal/auth/oauth_test.gointernal/cmd/cmd_test.gointernal/cmd/sentinel_test.go
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
A fresh
flagsmith initwith an old login still in the keychain fails instead of logging in:In this PR, we classify an
invalid_grantresponse to a refresh asauth.ErrSessionExpired, which matchesauth.ErrNotLoggedIn. This way:flagsmith inittakes its existing inline-login path for an expired session, same as for no session at all.ErrRefreshFailed, so e.g. flaky network doesn't send anyone through a browser login.