Skip to content

feat(client): optional 401 auto-refresh hook so user-session apps can drop proactive is_expired() checks #89

Description

@nycomp

Deferred from #87 (item 3, "smaller"): JsonClient-level auto-refresh on 401 would let user-session apps stop depending on proactive is_expired() checks. campus-classroom leans on with_user_session()'s proactive refresh; a token that expires mid-request (expiry-skew window) still surfaces the 401 to the app.

Problem

CampusRequest (json_client/init.py) has no retry path: a 401 from any verb propagates to the caller. Apps must pre-empt expiry themselves (_get_token_from_session(refresh_if_expired=True)), which cannot close the race where the token dies between the proactive check and the request.

Suggested shape

Reference: #87 (closed by #88, which delivered the refresh grant + device-flow parity items).

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions