Merge pull request 'claude-code: a login is succeeded by its own refresh, not only by a newer lineage (H-A-139)' (#713) from fix/licence-file-the-cli-accepts into main
This commit was merged in pull request #713.
This commit is contained in:
@@ -635,11 +635,11 @@ func Apply(p Paths, c Current, sealed SealedBox, write WriteManaged) (map[string
|
||||
return map[string]any{"applied": false, "licence": c.Licence, "reason": LoginKept}, nil
|
||||
}
|
||||
// A login handed to the manager is replaced only by a grant of a newer lineage (its refresh token's
|
||||
// expiry later than the login's, as the manager marks it): a lease older than the login is never
|
||||
// expiry later than the login's, or the same lineage with a later access expiry, as the manager's refresh yields it): a lease older than the login is never
|
||||
// written, so the manager's failed refresh is a finding on the manager, never a lost login here
|
||||
// (H-A-138, hq design/47-H1-answers-59 175ed320).
|
||||
if HoldsLogin(local) && !NewerLineage(local, g) {
|
||||
log.Printf("login kept: the grant offered for licence %s is not of a newer lineage than the login in the credentials file", c.Licence)
|
||||
// (H-A-138, hq design/47-H1-answers-59 175ed320; H-A-139, e359911e).
|
||||
if HoldsLogin(local) && !Succeeds(local, g) {
|
||||
log.Printf("login kept: the grant offered for licence %s does not succeed the login in the credentials file", c.Licence)
|
||||
return map[string]any{"applied": false, "licence": c.Licence, "reason": LoginKept}, nil
|
||||
}
|
||||
d := DecideApply(GrantOf(local), g, switched || HoldsLogin(local))
|
||||
|
||||
Reference in New Issue
Block a user