Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle expired refresh tokens "gracefully" #27

Merged
merged 2 commits into from
Jun 23, 2024

Conversation

WebGL3D
Copy link
Member

@WebGL3D WebGL3D commented Jun 23, 2024

Right now, an expired refresh token will throw:

Unhandled exception caught by middleware. Request to Roblox failed.
	Status Code: BadRequest
	Url: https://apis.roblox.com/oauth/v1/token
	Error (invalid_grant): Token has expired
   at Roblox.Api.HttpClientExtensions.SendApiRequestAsync[TResult](HttpClient httpClient, HttpRequestMessage httpRequest, String endpoint, CancellationToken cancellationToken)
   at Roblox.Authentication.AuthenticationClient.UncachedRefreshAsync(String refreshToken, CancellationToken cancellationToken)

If a token has expired, we should treat it the same way we should wrap it in a RobloxUnauthenticatedException, which we throw when a request to Roblox is unauthenticated.

@WebGL3D WebGL3D marked this pull request as ready for review June 23, 2024 14:23
@WebGL3D WebGL3D merged commit 3d890cd into main Jun 23, 2024
2 checks passed
@WebGL3D WebGL3D deleted the adhoc/handle-expired-refresh-tokens branch June 23, 2024 14:26
WebGL3D added a commit to roblox-plus/extension that referenced this pull request Jun 23, 2024
WebGL3D added a commit to roblox-plus/extension that referenced this pull request Jun 23, 2024
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