Skip to content

Commit

Permalink
Merge pull request #83 from chainsawriot/fix82
Browse files Browse the repository at this point in the history
fix #82
  • Loading branch information
schochastics authored Nov 17, 2022
2 parents 9769f3f + e9f97ec commit b706139
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions R/auth.R
Original file line number Diff line number Diff line change
Expand Up @@ -282,21 +282,20 @@ check_token_rtoot <- function(token = NULL) {
selection <- 2L
}
}

if (isTRUE(selection == 1L)) {
token <- auth_setup()
} else if (isTRUE(selection == 2L)) {
stop("No token found. Please run auth_setup() to authenticate.")
}
} else if (!is_auth_rtoot(token)) {
if (interactive()) {
selection <- utils::menu(
c("yes", "no"),
title = "Your token is invalid. Do you want to authenticate now?"
)
)
} else {
selection <- 2L
}
}
if (isTRUE(selection == 1L)) {
token <- auth_setup()
} else if (isTRUE(selection == 2L)) {
stop("No token found. Please run auth_setup() to authenticate.")
}
invisible(token)
}

0 comments on commit b706139

Please sign in to comment.