From 6f1741e3564b7e91cf8d39c6fc3dadd3ecb963a8 Mon Sep 17 00:00:00 2001 From: "florian.lahn" Date: Mon, 19 Sep 2022 12:09:20 +0200 Subject: [PATCH 1/3] removed oauth_flow_check() in oauth_flow_device - fixes #170 - checking interactiveness at that point prevented the code block about printing url and device code for manual browser interaction from being ever executed --- R/oauth-flow-device.R | 1 - 1 file changed, 1 deletion(-) diff --git a/R/oauth-flow-device.R b/R/oauth-flow-device.R index ab25cfd2c..d07e7de1f 100644 --- a/R/oauth-flow-device.R +++ b/R/oauth-flow-device.R @@ -58,7 +58,6 @@ oauth_flow_device <- function(client, scope = NULL, auth_params = list(), token_params = list()) { - oauth_flow_check("device", client, interactive = TRUE) if (pkce) { code <- oauth_flow_auth_code_pkce() From 94645e457122684f9b84504f3800e205140506ae Mon Sep 17 00:00:00 2001 From: "florian.lahn" Date: Wed, 21 Sep 2022 14:53:35 +0200 Subject: [PATCH 2/3] readded the oauth_flow_check() with rlang::is_interactive() - oauth_flow_check() should handle still the object check of `client`, but disable the check about interactiveness --- R/oauth-flow-device.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/oauth-flow-device.R b/R/oauth-flow-device.R index d07e7de1f..5e4d273ad 100644 --- a/R/oauth-flow-device.R +++ b/R/oauth-flow-device.R @@ -58,6 +58,7 @@ oauth_flow_device <- function(client, scope = NULL, auth_params = list(), token_params = list()) { + oauth_flow_check("device", client, interactive = is_interactive()) if (pkce) { code <- oauth_flow_auth_code_pkce() From c4b36e4e9ad8638d584c1d343a4a9526d2248d3b Mon Sep 17 00:00:00 2001 From: "florian.lahn" Date: Wed, 21 Sep 2022 14:59:44 +0200 Subject: [PATCH 3/3] NEWS entry --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index f3128a8fd..02c7cb2a7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # httr2 (development version) +* disabled check for interactive session `oauth_flow_check(..., interactive)` on device code flow to print URL and device code as intended (@flahn, #170) + * The environment variable `HTTR2_REFRESH_TOKEN` replaces the previous `HTTR_REFRESH_TOKEN` (@jennybc, #169). * OAuth tokens can now be refreshed. One, two, or even more times! (@jennybc, #166)