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

New PR for #460

Merged
merged 12 commits into from
Jul 27, 2017
Prev Previous commit
Next Next commit
updated with styling
  • Loading branch information
muschellij2 committed Jul 26, 2017
commit c34040e4d19bf02e1bd041fe43626a658670f8cb
5 changes: 3 additions & 2 deletions R/oauth-init.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ init_oauth1.0 <- function(endpoint, app, permission = NULL,
#' If \code{FALSE}, the default, retrieve the token by including the
#' app key and secret in the request body.
#' @param config_init Additional configuration settings sent to
#' \code{\link{POST}}, e.g. \code{\link{user_agent}}.
#' \code{\link{POST}}, e.g. \code{\link{user_agent}}.
#' @export
#' @keywords internal
init_oauth2.0 <- function(endpoint, app, scope = NULL, user_params = NULL,
Expand Down Expand Up @@ -111,7 +111,8 @@ init_oauth2.0 <- function(endpoint, app, scope = NULL, user_params = NULL,

if (isTRUE(use_basic_auth)) {
req <- POST(endpoint$access, encode = "form", body = req_params,
authenticate(app$key, app$secret, type = "basic"), config = config_init)
authenticate(app$key, app$secret, type = "basic"),
Copy link
Member

Choose a reason for hiding this comment

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

This still isn't indented correctly. It should look like

req <- POST(endpoint$access, 
   encode = "form", 
   body = req_params,
   authenticate(app$key, app$secret, type = "basic"),
   config = config_init
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've made the edits and pushed. Why is RStudio Reindent-Lines not tidyverse-style-compatible?

config = config_init)
} else {
req_params$client_secret <- app$secret
req <- POST(endpoint$access, encode = "form", body = req_params,
Expand Down
9 changes: 5 additions & 4 deletions demo/oauth2-reddit.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ token <- oauth2.0_token(reddit, app,

# 3b. If get 429 too many requests, the default user_agent is overloaded.
# If you have an application on Reddit then you can pass that using:
token <- oauth2.0_token(reddit, app,
scope = c("read", "modposts"),
use_basic_auth = TRUE,
config_init = user_agent("YOUR_USER_AGENT")
token <- oauth2.0_token(
reddit, app,
scope = c("read", "modposts"),
use_basic_auth = TRUE,
config_init = user_agent("YOUR_USER_AGENT")
)