Shiny authentication module for use with loginUI
login(input, output, session, data, user_col, pwd_col, sodium_hashed = FALSE, hashed, algo, log_out = NULL)
input | shiny input |
---|---|
output | shiny output |
session | shiny session |
data | data frame or tibble containing usernames, passwords and other user data |
user_col | bare (unquoted) column name containing usernames |
pwd_col | bare (unquoted) column name containing passwords |
sodium_hashed | have the passwords been hash encrypted using the sodium package? defaults to FALSE |
hashed | Deprecated. shinyauthr now uses the sodium package for password hashing and decryption. If you have previously hashed your passwords with the digest package to use with shinyauthr please re-hash them with sodium for decryption to work. |
algo | Deprecated |
log_out | [reactive] supply the returned reactive from logout here to trigger a user logout |
The module will return a reactive 2 element list to your main application.
First element user_auth
is a boolean inditcating whether there has been
a successful login or not. Second element info
will be the data frame provided
to the function, filtered to the row matching the succesfully logged in username.
When user_auth
is FALSE info
is NULL.
Call via shiny::callModule(login, "your_id", ...)
if (FALSE) { user_credentials <- shiny::callModule(login, "login", data = user_base, user_col = user, pwd_col = password, log_out = reactive(logout_init())) }