密码字段使用R Shiny框架

Ama*_*hur 9 r shiny

我打算为我的应用程序登录.为此,我需要一个密码字段.我不知道是否有光泽甚至用于此目的,但仍然可能吗?

#code for a simple text box is 
textInput("id","label","value")
Run Code Online (Sandbox Code Playgroud)

但是有可能存在密码字段吗?

Mat*_*ert 5

另外,与此同时,还有一个本地人

passwordInput("passwd",label = "Enter password")
Run Code Online (Sandbox Code Playgroud)

密码输入闪亮。这个功能在闪亮的 0.11.1 中可用。这是您的可重现示例:

library(shiny)
shinyApp(ui = fluidPage(

tabPanel("Login",
       br(),
       tags$form(
         passwordInput("passwd",label = "Enter password"),
         submitButton("send passwd to shiny")
       ),
       textOutput("pwd")

 )
),
server = function(input, output,session) {

output$pwd <- renderText({
paste0("Your PW is: ",input$passwd)
})


})
Run Code Online (Sandbox Code Playgroud)

请注意,密码位于会话中,那么我不太确定input$passwd登录成功后如何删除密码。