Skip to content

Commit

Permalink
refactor client function
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestguevarra committed Apr 24, 2024
1 parent e247b31 commit cba4a2b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions R/icd_authenticate.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,17 @@
#'
#' @export
#'
icd_oauth_client <- function(id = "6fc8a1e4-4da9-43a8-bd0c-c164c0cb0ebd_3c7e272e-2f4b-46de-b127-df7454e36be8",
icd_oauth_client <- function(id = Sys.getenv("ICD_CLIENT_ID"),
token_url = "https://icdaccessmanagement.who.int/connect/token",
secret = "OGIly8mTatQ2ILuhBTbviIp2FofWiQR3fj4HaPiGseE=",
secret = Sys.getenv("ICD_CLIENT_SECRET"),
name = "icd_client",
...) {
if (id == "")
id <- "6fc8a1e4-4da9-43a8-bd0c-c164c0cb0ebd_3c7e272e-2f4b-46de-b127-df7454e36be8"

if (secret == "")
secret <- "OGIly8mTatQ2ILuhBTbviIp2FofWiQR3fj4HaPiGseE="

httr2::oauth_client(
id = id,
token_url = token_url,
Expand Down
4 changes: 2 additions & 2 deletions man/icd_authenticate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cba4a2b

Please sign in to comment.