I am making a shiny app which will show a dashboard but before that, it will ask for user login. There are two UIs, ui_login and ui_app, But in the ui_app if I use fluidPage/fixedPage or some other instead of dashboardPage it's working fine. Is there any way that I can show the dashboardPage after login.
library(shiny)
library(shinydashboard)
my_username = "user"
my_password = "pass"
ui <- uiOutput("page")
ui_login <- fluidPage(
  div(
    textInput("username", "Username"),
    passwordInput("passwd", "Password"),
    br(),
    actionButton("Login", "Log In"),
    uiOutput("invalid")
  )
)
ui_app <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(),
  dashboardBody()
)
server <- function(input, output, session) {
  #app server code-----
  observe({
    if(USER$Logged == FALSE) {
      if(!is.null(input$Login)) {
        if(input$Login > 0) {
          Username <- isolate(input$username)
          Password <- isolate(input$passwd)
          if((Username == my_username) & (Password == my_password)){
            USER$Logged = TRUE
          }
          else {
            output$invalid <- renderUI(h4("Please enter valid login credentials!", style="color:red;"))
          }
        }
      }
    }
    else {
      output$invalid <- renderUI(h4("Please enter valid login credentials!", style="color:red;"))
    }
  })
  observe({
    if(USER$Logged == FALSE) {
      output$page <- renderUI(ui_login) 
    }
    else {
      output$page <- renderUI(ui_app) 
    }
  })
}
shinyApp(ui, server)
 
    