Skip to content

Commit

Permalink
Remove OAuth2 login parameter approval_prompt as its replaced by `p…
Browse files Browse the repository at this point in the history
…rompt` (#177)
  • Loading branch information
MarkEdmondson1234 committed Apr 24, 2020
1 parent db5700a commit 363ceb2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Fix `gar_debug_parsing()` message
* Remove deprecated `gar_auth_jsUI` since it causes an issue when used
* Add functions `gar_service_*` to provision service accounts via R (#178)
* Remove OAuth2 login parameter `approval_prompt` as its replaced by `prompt` (#177 - thanks @OuNao)

# googleAuthR v1.1.1

Expand Down
16 changes: 8 additions & 8 deletions R/shiny-js-auth.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @param logout_class CSS class of logout button
#' @param login_text Text to show on login button
#' @param logout_text Text to show on logout button
#' @param approval_prompt_force Whether to force a login each time
#' @param prompt The type of login screen
#' @param scopes Set the scopes, minimum needs is "email"
#'
#' @return Shiny UI
Expand All @@ -20,27 +20,27 @@ googleAuth_jsUI <- function(id,
logout_class = "btn btn-danger",
login_text = "Log In",
logout_text = "Log Out",
approval_prompt_force = TRUE,
prompt = c("consent", "select_account", "both", "none"),
scopes = getOption("googleAuthR.scopes.selected", "email")){
check_package_loaded("shiny")
prompt <- match.arg(prompt)

assert_that(
is.string(login_class),
is.string(logout_class),
is.string(login_text),
is.string(logout_text),
is.flag(approval_prompt_force),
!is.null(scopes)
)

if(approval_prompt_force){
approval_prompt_line <- ",\n 'approval_prompt':'force'"
} else {
approval_prompt_line <-NULL
if(prompt == "both"){
prompt <- "consent select_account"
}

approval_prompt_line <- paste0(",\n 'prompt':'",prompt,"'")

## No @import to avoid making shiny and miniUI an import
check_package_loaded("shiny")

ns <- shiny::NS(id)
shiny::tagList(

Expand Down
2 changes: 1 addition & 1 deletion man/gar_service_create.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/gar_service_provision.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/googleAuth_jsUI.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 363ceb2

Please sign in to comment.