login | R Documentation |
Deprecated. Use loginServer instead.
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 |
sessionid_col |
bare (unquoted) column name containing session ids |
cookie_getter |
a function that returns a data.frame with at least two columns: user and session |
cookie_setter |
a function with two parameters: user and session. The function must save these to a database. |
reload_on_logout |
should app force reload on logout? |
Shiny authentication module for use with loginUI
Call via shiny::callModule(shinyauthr::login, "id", ...)
This function is now deprecated in favour of loginServer which uses shiny's new moduleServer method as opposed to the callModule method used by this function. See the loginServer documentation For details on how to migrate.
The module will return a reactive 2 element list to your main application.
First element user_auth
is a boolean indicating 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 successfully logged in username.
When user_auth
is FALSE info
is NULL.
## Not run:
user_credentials <- shiny::callModule(
login,
id = "login",
data = user_base,
user_col = user,
pwd_col = password,
log_out = reactive(logout_init())
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.