Skip to content

Commit a8d8323

Browse files
Merge pull request #113 from OxfordIHTM/dev
refactor client function
2 parents ef9da8d + cba4a2b commit a8d8323

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

R/icd_authenticate.R

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,17 @@
2525
#'
2626
#' @export
2727
#'
28-
icd_oauth_client <- function(id = "6fc8a1e4-4da9-43a8-bd0c-c164c0cb0ebd_3c7e272e-2f4b-46de-b127-df7454e36be8",
28+
icd_oauth_client <- function(id = Sys.getenv("ICD_CLIENT_ID"),
2929
token_url = "https://icdaccessmanagement.who.int/connect/token",
30-
secret = "OGIly8mTatQ2ILuhBTbviIp2FofWiQR3fj4HaPiGseE=",
30+
secret = Sys.getenv("ICD_CLIENT_SECRET"),
3131
name = "icd_client",
3232
...) {
33+
if (id == "")
34+
id <- "6fc8a1e4-4da9-43a8-bd0c-c164c0cb0ebd_3c7e272e-2f4b-46de-b127-df7454e36be8"
35+
36+
if (secret == "")
37+
secret <- "OGIly8mTatQ2ILuhBTbviIp2FofWiQR3fj4HaPiGseE="
38+
3339
httr2::oauth_client(
3440
id = id,
3541
token_url = token_url,

man/icd_authenticate.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)