Skip to content

Fix: Preserve refresh token if not returned in OAuth refresh response#88

Merged
dnplus merged 1 commit intodnplus:mainfrom
LounesAl:fix-refresh-token
Jul 7, 2025
Merged

Fix: Preserve refresh token if not returned in OAuth refresh response#88
dnplus merged 1 commit intodnplus:mainfrom
LounesAl:fix-refresh-token

Conversation

@LounesAl
Copy link
Copy Markdown
Contributor

@LounesAl LounesAl commented Jul 6, 2025

When using Google OAuth, the refresh response sometimes omits the refresh_token field. Without preserving the previous refresh token, users may lose the ability to refresh tokens in the future.

This PR ensures that if the refreshed token response is missing a refresh_token, the original one is retained.

  • Checks for a missing refresh_token in the new token.
  • If missing, copies the old refresh_token into the new token before returning.

This aligns with best practices for OAuth token management, and improves compatibility with Google OAuth.

Closes #87

@dnplus dnplus merged commit ba72884 into dnplus:main Jul 7, 2025
1 check passed
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.

Refresh token is sometimes missing from OAuth response, causing loss of refresh ability

2 participants