Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #82 #83

Merged
merged 1 commit into from
Nov 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}