Skip to content

Commit

Permalink
Merge pull request #58 from hadley/dev-httr2
Browse files Browse the repository at this point in the history
 Use the new function httr2::oauth_cache_clear() from httr2 v1.0.6
  • Loading branch information
jmaspons authored Nov 12, 2024
2 parents 7c5f857 + 171b8bc commit 0c4409e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ URL: https://docs.ropensci.org/osmapiR/,
BugReports: https://github.com/ropensci/osmapiR/issues
Imports:
curl,
httr2,
httr2 (>= 1.0.6),
xml2
Suggests:
httptest2,
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# osmapiR (development version)

* Use the new function `httr2::oauth_cache_clear()` from httr2 1.0.6 (#58 by @hadley).

# osmapiR 0.2.1

* Update CITATION with the JOSS article (<https://doi.org/10.21105/joss.07151>).
Expand Down
8 changes: 5 additions & 3 deletions R/osmapiR_connection.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,11 @@ authenticate_osmapi <- function() {
#' @rdname authenticate_osmapiR
#' @export
logout_osmapi <- function() {
req <- httr2::request(base_url = get_osmapi_url())
req <- oauth_request(req)
req$policies$auth_oauth$cache$clear()
httr2::oauth_cache_clear(
client = oauth_client_osmapi(),
cache_disk = getOption("osmapir.cache_authentication"),
cache_key = getOption("osmapir.base_api_url")
)

message("Logged out from ", get_osmapi_url())

Expand Down

0 comments on commit 0c4409e

Please sign in to comment.