diff --git a/R/auth.R b/R/auth.R index acd176b..b319f58 100644 --- a/R/auth.R +++ b/R/auth.R @@ -26,6 +26,9 @@ auth_setup <- function(instance = NULL, type = NULL, name = NULL, path = NULL, c while (is.null(instance) || instance == "") { instance <- rtoot_ask(prompt = "On which instance do you want to authenticate (e.g., \"mastodon.social\")? ", pass = FALSE) } + if(quoted_string(instance)){ + instance <- substr(instance, 2, nchar(instance)-1) + } client <- get_client(instance = instance) if (!isTRUE(type %in% c("public", "user"))) { type <- c("public", "user")[rtoot_menu(choices = c("public", "user"), title = "What type of token do you want?", verbose = TRUE)] diff --git a/R/utils.R b/R/utils.R index d9723d3..7c78e43 100644 --- a/R/utils.R +++ b/R/utils.R @@ -265,3 +265,8 @@ break_process_request <- function(api_response, retryonratelimit = FALSE, verbos } return(FALSE) } + +## a function to determine if input to readline has been quoted or not +quoted_string <- function(x){ + (grepl("^\"", x) && grepl("\"$", x)) || (grepl("^'", x) && grepl("'$", x)) +}