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

Add OAuth2::Client#make_token_request returning HTTP response #12921

Conversation

cyangle
Copy link
Contributor

@cyangle cyangle commented Jan 9, 2023

Make OAuth2::Client#get_access_token a public method

So that one can pass custom headers and form params

@straight-shoota
Copy link
Member

Thanks for this patch.

I think we should talk about the reasoning behind this and potentially evaluate alternative API solutions.
Could you please open an issue about that and explain your use case?

@cyangle cyangle changed the title Expose OAuth2::Client#get_access_token Add OAuth2::Client#make_token_request that returns http response Jan 10, 2023
}

# Makes a token exchange request with custom headers and form fields
# Returns a HTTP::Client::Response
Copy link
Member

Choose a reason for hiding this comment

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

This is superfluous. The return type is sufficiently indicated in the method signature.

Suggested change
# Returns a HTTP::Client::Response

@straight-shoota straight-shoota changed the title Add OAuth2::Client#make_token_request that returns http response Add OAuth2::Client#make_token_request returning HTTP response Feb 4, 2023
Copy link
Member

@sdogruyol sdogruyol left a comment

Choose a reason for hiding this comment

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

Thank you @cyangle 🙏

@straight-shoota straight-shoota added this to the 1.8.0 milestone Feb 4, 2023
@straight-shoota straight-shoota merged commit 61ea033 into crystal-lang:master Feb 6, 2023
@cyangle cyangle deleted the expose_OAuth2_Client_get_access_token branch February 7, 2023 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add OAuth2::Client#make_token_request that returns http response
4 participants