Skip to content

Conversation

dominic-ks
Copy link
Collaborator

This PR addresses the same topic as the previous #115 (Give refresh_token in JSON response) and #116 (Feature/refresh token flow).

Background

This is an important feature, but the previous PR had several unresolved issues and has been inactive for a while.
While I reviewed the earlier implementation, it was unclear which specific changes were required.
As such, I've taken a simpler, more generic approach starting from scratch.

Summary of Changes

  • Backward compatible: Existing cookie-based refresh token handling remains unchanged.
  • New token_transport option:
    • cookie (default) → existing behavior (refresh token set as a cookie).
    • body → refresh token is included in the response body, and any existing cookies are invalidated.
      • Token is only sent once, allowing the client to manage it directly.
  • Token validation:
    • Server will first check for the refresh token in the request body.
    • If not present, it will fall back to the cookie.

Next Steps

I still need to update:

  • README
  • Tests

Posting this now for feedback and buy-in before continuing.

@dominic-ks dominic-ks mentioned this pull request Jul 29, 2025
3 tasks
@dominic-ks dominic-ks requested review from sun and pesseba July 29, 2025 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant