Skip to content

Commit

Permalink
Reduce connection timeout to 5s
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Sep 7, 2024
1 parent 5087aea commit a7f9e32
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions R/gh_token.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,20 @@ gh_token <- function(api_url = NULL) {
gh_pat(token$password %||% "")
}

#' @export
#' @rdname gh_token
gh_token_exists <- function(api_url = NULL) {
api_url <- api_url %||% default_api_url()
tryCatch(
{
token <- gitcreds::gitcreds_get(get_hosturl(api_url))
gh_pat(token$password)
TRUE
} ,
error = function(e) FALSE
)
}

gh_auth <- function(token) {
if (isTRUE(token != "")) {
if (any(grepl("\\W", token))) {
Expand Down

0 comments on commit a7f9e32

Please sign in to comment.