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

Use DeviceCodeErrorResponseType::ExpiredToken for expired Device #195

Merged
merged 3 commits into from
Nov 8, 2022

Conversation

LorenzoLeonardo
Copy link
Contributor

Hello David

Here is the changed to use the DeviceCodeErrorResponseType::ExpiredToken and the Unit Test changes.

LorenzoLeonardo and others added 2 commits October 21, 2022 06:13
This is a async example for using oauth2-rs library
especially for device code workflow.
Copy link
Owner

@ramosbugs ramosbugs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR!

src/tests.rs Outdated Show resolved Hide resolved
It is good to use RequestTokenError::ServerResponse for expired
Device token instead of having a "Device code expired" string
is set to Other(). We see to it that they are have the same Error
with the error came from the endpoint. There was a timing
issue found that expired_token is returned from the endpoint
and sometimes the RequestTokenError::Other() was returned
after the expiration time given by the endpoint.

We make it uniform for easy error handling upon use.
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.

2 participants