From e9f97ec8d73d725757f1ed08722a247198c78576 Mon Sep 17 00:00:00 2001 From: chainsawriot Date: Thu, 17 Nov 2022 11:45:56 +0100 Subject: [PATCH] fix #82 --- R/auth.R | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/R/auth.R b/R/auth.R index d63621f..11ae17e 100644 --- a/R/auth.R +++ b/R/auth.R @@ -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) }