The access_token expiration value is not stored correctly by the GitHub backend, leading to the refresh token functionality not being triggered.
This issue occurs because the GitHub backend uses a different key (expires^1) than the one used by GitHub (and by extension, the OAuth2 RFC^2), which is expires_in^3. This misconfiguration results in the expiration value always being None^4, preventing the refresh functionality from being called^5.
In order for the refresh functionality, that is already present in the UserMixin^6 and BaseOAuth2^7, to be utilized by the GitHub backend, we have to also include the refresh_token key in the extra_data^1. This ensures that we always store it and use it as outlined by GitHub^3.
The
access_token
expiration value is not stored correctly by the GitHub backend, leading to the refresh token functionality not being triggered.This issue occurs because the GitHub backend uses a different key (
expires
^1) than the one used by GitHub (and by extension, the OAuth2 RFC^2), which isexpires_in
^3. This misconfiguration results in the expiration value always beingNone
^4, preventing the refresh functionality from being called^5.In order for the refresh functionality, that is already present in the
UserMixin
^6 andBaseOAuth2
^7, to be utilized by the GitHub backend, we have to also include therefresh_token
key in theextra_data
^1. This ensures that we always store it and use it as outlined by GitHub^3.I’ll open a pull request handling the issue.