login: login server module (deprecated)

View source: R/login.R

loginR Documentation

login server module (deprecated)

Description

Deprecated. Use loginServer instead.

Arguments

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?

Details

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.

Value

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.

Examples

## 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)


PaulC91/shinyauthr documentation built on March 9, 2024, 7:10 a.m.