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

Default to the "oob" flow if httpuv isn't installed. #168

Merged
merged 1 commit into from
Dec 3, 2014

Conversation

craigcitro
Copy link
Contributor

This modifies the logic in oauth token fetching to default to using the oob
flow (i.e. provide a URL and ask the user to copy-paste a code) whenever
httpuv isn't available to use locally.

PTAL @hadley @deflaux

@deflaux
Copy link

deflaux commented Dec 2, 2014

@craigcitro Looks good to me! This is a great change to reduce some getting-started friction.

#' @export
#' @keywords internal
init_oauth2.0 <- function(endpoint, app, scope = NULL, type = NULL,
use_oob = getOption("httr_oob_default"),
is_interactive = interactive()) {
if (!is_installed("httpuv")) {
use_oob = TRUE
Copy link
Member

Choose a reason for hiding this comment

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

I'd print a message here: message("httpuv not installed, defaulting to out-of-band auth") (and then also check that use_oob isn't already true

(Also <- please!)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done -- i'm now in the dubious position of having a condition like (!a && !b), which i generally try to avoid -- but in this case i think it reads more clearly than !(a || b). feel free to disagree. :)

fixed the = ... my days spent with python are showing.

@craigcitro
Copy link
Contributor Author

PTAL

@hadley
Copy link
Member

hadley commented Dec 3, 2014

Looks good to me. Just needs a bullet in news.

This modifies the logic in oauth token fetching to default to using the `oob`
flow (i.e. provide a URL and ask the user to copy-paste a code) whenever
`httpuv` isn't available to use locally.
@craigcitro
Copy link
Contributor Author

done.

hadley added a commit that referenced this pull request Dec 3, 2014
Default to the "oob" flow if httpuv isn't installed.
@hadley hadley merged commit fdbdfef into r-lib:master Dec 3, 2014
@hadley
Copy link
Member

hadley commented Dec 3, 2014

Thanks!

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.

None yet

3 participants