You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an application which uses the shinymanager library for user login. I want to use the session$onSessionEnded() to close my app once the browser is closed. As suggested by @ismirsehregal here shinymanager with onsessioneneded() the workaround is working fine for the login but if we logout or going to administrator mode (while using db) the app is getting stopped. Could you please provide a workaround for this. samplecode
such as using shinymanager with DesktopDeployR(A framework for deploying self-contained R-based applications to the desktop), session$onSessionEnded(function() {stopApp()})IMPORTANT! this is needed to terminate the R process when the shiny app session ends. Otherwise, you end up with a zombie process
I have an application which uses the shinymanager library for user login. I want to use the session$onSessionEnded() to close my app once the browser is closed. As suggested by @ismirsehregal here shinymanager with onsessioneneded() the workaround is working fine for the login but if we logout or going to administrator mode (while using db) the app is getting stopped. Could you please provide a workaround for this.
samplecode
`library(shiny)
library(shinyWidgets)
library(shinythemes)
library(shinymanager)
credentials <- data.frame(
user = c("admin", "shinymanager"), # mandatory
password = c("admin", "12345"), # mandatory
start = c("2022-04-15"), # optinal (all others)
expire = c(NA, "2026-12-31"),
admin = c(TRUE, TRUE),
comment = "Simple and secure authentification mechanism
for single ‘Shiny’ applications.",
stringsAsFactors = FALSE
)
ui <- fluidPage(
sliderInput("n", "Number of observations", 2, 1000, 500),
plotOutput("plot")
)
ui <- secure_app(ui)
server <- function(input, output, session) {
res_auth <- secure_server(
check_credentials = check_credentials(credentials)
)
session$onSessionEnded(function() {
print(paste("Session", session$token, "ended"))
if(!is.null(isolate({res_auth$user}))){
stopApp()
}
})
observe({
# Re-execute this reactive expression after 1000 milliseconds
invalidateLater(1000, session)
print(paste("The value of input$n is", isolate(input$n)))
})
output$plot <- renderPlot({
# Re-execute this reactive expression after 2000 milliseconds
invalidateLater(2000)
hist(rnorm(isolate(input$n)))
})
}
shinyApp(ui, server)`
The text was updated successfully, but these errors were encountered: