Skip to content

Commit

Permalink
feat: warn user when OTP setup is required
Browse files Browse the repository at this point in the history
  • Loading branch information
ymarcon committed Mar 15, 2024
1 parent 4c5cc8b commit 69768ea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/opal.R
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,9 @@ opal.delete <- function(opal, ..., query = list(), callback = NULL) {
opalUrl <- url
if (startsWith(url, "http://localhost:8080")) {
opalUrl <- gsub("http://localhost:8080", "https://localhost:8443", url)
warning("Deprecation: connecting through secure http is required. Replacing http://localhost:8080 by https://localhost:8443.")
warning("Deprecation: connecting through secure http is required. Replacing http://localhost:8080 by https://localhost:8443.", call. = FALSE)
} else if (startsWith(url, "http://")) {
stop("Deprecation: connecting through secure http is required.")
stop("Deprecation: connecting through secure http is required.", call. = FALSE)
}
urlObj <- httr::parse_url(opalUrl)

Expand Down Expand Up @@ -598,6 +598,10 @@ opal.delete <- function(opal, ..., query = list(), callback = NULL) {
opal$uprofile <- .handleResponse(opal, r)
opal$username <- opal$uprofile$principal

if (isTRUE(o$uprofile$otpRequired)) {
warning("Enabling 2FA is required, connect to Opal web page to set up your secret.", call. = FALSE)
}

opal
}

Expand Down

0 comments on commit 69768ea

Please sign in to comment.