module_login {lareshiny}R Documentation

Login Module for Shiny

Description

Login Module for Shiny with local User and Password. This must be added in the server section (no need to add UI)

Usage

module_login(
  input,
  session,
  users = c("123", "321"),
  pwds = c("123", "321"),
  logo = NA,
  logo_height = "100px",
  lang = "es",
  style = list(botton_txt_colour = "#FFFFFF", botton_bgd_colour = "#EBB600"),
  change_text = list(),
  logged = FALSE,
  personal = "MacBookBLB.local"
)

Arguments

input, session

Shiny's input and session objects.

users, pwds

Character Vector. User and password combinations accepted

Character. Select image for logo display. Host local file in your www directory preferably

logo_height

Character. Height for rendering the logo.

lang

Character. Language. Currently accepted: es, en

style

List. Possible values for styling the module such as botton_txt_colour and botton_bgd_colour.

change_text

Named list. Change the default texts used.

logged

Boolean. You might want to set to TRUE when developing or testing your app so this module doesn't show up every time. Check the personal parameter as well

personal

Character vector. If you wish to auto-login certain user(s), set the values from Sys.info()[["nodename"]].

Value

A reactiveValues object

Examples

if (interactive()) {
  ui <- fluidPage("Hello lareshiny!")
  server <- function(input, output, session) {
    login <- module_login(input, session, personal = "")
    observe({
      if (login$authenticated) message("We are in!")
    })
  }
  shinyApp(ui, server)
}

[Package lareshiny version 0.0.3 Index]