Skip to content

Commit

Permalink
feat: aux function to check if user in DB
Browse files Browse the repository at this point in the history
  • Loading branch information
ESCRI11 committed May 16, 2024
1 parent bf02a30 commit 4b5984a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions components/modules/AuthenticationModule_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ create_user_dir_if_needed <- function(user_dir, pgxdir) {
}
}

check_user_options_db <- function(email, user_database = NULL) {
if (is.null(user_database)) {
return(FALSE)
}
connection <- connect_db(user_database)
user_opt <- query_by_email(email, connection)
if(is.null(user_opt)) {
return(FALSE) # user NOT in db
} else {
return(TRUE) # user IN db
}
}

read_user_options <- function(user_dir) {
user_opt_file <- file.path(user_dir, "OPTIONS")
new_opt <- opt ## opt from global
Expand Down

0 comments on commit 4b5984a

Please sign in to comment.