Skip to content

Commit 1bab80c

Browse files
authored
Catch email = "" specifically (#142)
Closes #132
1 parent a230e83 commit 1bab80c

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

R/Gargle-class.R

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ gargle2.0_token <- function(email = gargle_oauth_email(),
7474
#' `"~/.R/gargle/gargle-oauth"`, i.e. at the user level. In contrast, the
7575
#' default location for `Token2.0` is `./.httr-oauth`, i.e. in current working
7676
#' directory. `Gargle2.0` behaviour makes it easier to reuse tokens across
77-
#' projects and makes it less likely that tokens are accidentally synched to a
77+
#' projects and makes it less likely that tokens are accidentally synced to a
7878
#' remote location like GitHub or DropBox.
7979
#' * Each `Gargle2.0` token is cached in its own file. The token cache is a
8080
#' directory of such files. In contrast, `Token2.0` tokens are cached as
@@ -115,7 +115,12 @@ Gargle2.0 <- R6::R6Class("Gargle2.0", inherit = httr::Token2.0, list(
115115
is_string(package),
116116
is.list(params)
117117
)
118-
118+
if (identical(email, "")) {
119+
abort(paste0(
120+
"`email` must not be \"\" (the empty string)\n",
121+
"Do you intend to consult an env var, but it's unset?"
122+
))
123+
}
119124
if (isTRUE(email)) {
120125
email <- "*"
121126
}

man/Gargle-class.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)