Skip to content

Commit 4d120be

Browse files
committed
Revert spurious changes
1 parent 9d0dfde commit 4d120be

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

R/oauth.R

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,20 +197,15 @@ cache_disk <- function(client, key = NULL) {
197197
dir.create(app_path, showWarnings = FALSE, recursive = TRUE)
198198

199199
path <- file.path(app_path, paste0(hash(key), "-token.rds.enc"))
200-
201200
list(
202201
get = function() {
203-
if (file.exists(path)) {
204-
secret_read_rds(path, obfuscate_key())
205-
} else {
206-
NULL
207-
}
202+
if (file.exists(path)) secret_read_rds(path, obfuscate_key()) else NULL
208203
},
209204
set = function(token) {
210205
cli::cli_inform("Caching httr2 token in {.path {path}}.")
211206
secret_write_rds(token, path, obfuscate_key())
212207
},
213-
clear = function() unlink(path)
208+
clear = function() if (file.exists(path)) file.remove(path)
214209
)
215210
}
216211

0 commit comments

Comments
 (0)