Description Usage Arguments Examples
New password module
1 2 3 4 5 6 7 8 9 10 11 12 | pwd_ui(id, tag_img = NULL, status = "primary", lan = NULL)
pwd_server(
input,
output,
session,
user,
update_pwd,
validate_pwd = NULL,
use_token = FALSE,
lan = NULL
)
|
id |
Module's id. |
tag_img |
A |
status |
Bootstrap status to use for the panel and the button.
Valid status are: |
lan |
An langauge object. Should not be used directly. |
input, output, session |
Standard Shiny server arguments. |
user |
A |
update_pwd |
A |
validate_pwd |
A |
use_token |
Add a token in the URL to check authentication. Should not be used directly. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | if (interactive()) {
library(shiny)
library(shinymanager)
ui <- fluidPage(
tags$h2("Change password module"),
actionButton(
inputId = "ask", label = "Ask to change password"
),
verbatimTextOutput(outputId = "res_pwd")
)
server <- function(input, output, session) {
observeEvent(input$ask, {
insertUI(
selector = "body",
ui = tags$div(
id = "module-pwd",
pwd_ui(id = "pwd")
)
)
})
output$res_pwd <- renderPrint({
reactiveValuesToList(pwd_out)
})
pwd_out <- callModule(
module = pwd_server,
id = "pwd",
user = reactiveValues(user = "me"),
update_pwd = function(user, pwd) {
# store the password somewhere
list(result = TRUE)
}
)
observeEvent(pwd_out$relog, {
removeUI(selector = "#module-pwd")
})
}
shinyApp(ui, server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.