Skip to content

Commit

Permalink
update DESCRIPTION, NEWS.md, run_app.R and utils_startup.R for master
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-Krajcik committed Aug 14, 2023
1 parent 0f56086 commit d28b7f1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 23 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: riskassessment
Title: A web app designed to interface with the `riskmetric` package
Version: 2.0.0.9000
Version: 2.0.0
Authors@R: c(
person("Aaron", "Clark", role = c("aut", "cre"), email = "[email protected]"),
person("Robert", "Krajcik", role = "aut", email = "[email protected]"),
Expand Down
2 changes: 0 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# riskassessment (development version)

# riskassessment 2.0.0

### Enhancements
Expand Down
38 changes: 19 additions & 19 deletions R/run_app.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,23 @@ run_app <- function(
}

# Note that this overrides other credential set up
login_creds <- NULL
pre_auth_user <- NULL
if (isFALSE(getOption("golem.app.prod"))) {
arg_lst <- as.list(match.call())

login_creds <- list(user_id = "",
user_pwd = "cxk1QEMYSpYcrNB")
if (!is.null(arg_lst$pre_auth_user)) {
pre_auth_user <- arg_lst$pre_auth_user
if (isTRUE(pre_auth_user) || pre_auth_user == "admin") {
login_creds$user_id <- "admin"
} else {
login_creds$user_id <- pre_auth_user
}
credentials_db_name <- gsub("\\.sqlite", "_dev\\.sqlite", credentials_db_name)
}
}
# login_creds <- NULL
# pre_auth_user <- NULL
# if (isFALSE(getOption("golem.app.prod"))) {
# arg_lst <- as.list(match.call())
#
# login_creds <- list(user_id = "",
# user_pwd = "cxk1QEMYSpYcrNB")
# if (!is.null(arg_lst$pre_auth_user)) {
# pre_auth_user <- arg_lst$pre_auth_user
# if (isTRUE(pre_auth_user) || pre_auth_user == "admin") {
# login_creds$user_id <- "admin"
# } else {
# login_creds$user_id <- pre_auth_user
# }
# credentials_db_name <- gsub("\\.sqlite", "_dev\\.sqlite", credentials_db_name)
# }
# }

# Run the app
with_golem_options(
Expand All @@ -75,8 +75,8 @@ run_app <- function(
golem_opts = list(app_version = app_ver,
credentials_db_name = credentials_db_name,
assessment_db_name = assessment_db_name,
pre_auth_user = pre_auth_user,
login_creds = login_creds,
# pre_auth_user = pre_auth_user,
# login_creds = login_creds,
decision_categories = decision_categories,
...)
)
Expand Down
2 changes: 1 addition & 1 deletion R/utils_startup.R
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ initialize_raa <- function(assess_db, cred_db, decision_cat) {

check_credentials(db_config[["credentials"]])

if (isFALSE(getOption("golem.app.prod")) && !is.null(golem::get_golem_options('pre_auth_user')) && !file.exists(credentials_db)) create_credentials_dev_db(credentials_db)
# if (isFALSE(getOption("golem.app.prod")) && !is.null(golem::get_golem_options('pre_auth_user')) && !file.exists(credentials_db)) create_credentials_dev_db(credentials_db)

# Create package db & credentials db if it doesn't exist yet.
if(!file.exists(assessment_db)) create_db(assessment_db)
Expand Down

0 comments on commit d28b7f1

Please sign in to comment.