I would like to logout and auth screen to appear when the user clicks on a button.
credentials <- data.frame(
user = "x",
password = "x"
)
library(shiny)
library(shinymanager)
ui <- fluidPage(
tags$h2("My secure application"),
actionButton("action_logout", "Logout!")
)
ui <- secure_app(ui)
server <- function(input, output, session) {
res_auth <- secure_server(
check_credentials = check_credentials(credentials)
)
observeEvent(input$action_logout, {
# logout
})
}
shinyApp(ui, server)
I found out that shinymanager's default logout button in the lower right corner has id = ".shinymanager_logout", so I tried to call that with session$sendCustomMessage(".shinymanager_logout", 1). That's probably a very naive way.
How can I logout the user with my custom logout button?