Closed Sbirch556 closed 3 years ago
i haven't tried with login, but maybe something like this would work? swap logout for login, of course.
dashboardPage(
title = 'My Title',
skin = 'purple',
header = dashboardHeader(
title ="My Dashboard",
titleWidth = 200,
tags$li(a(div(logoutUI(id = "logout"))),class='dropdown')),
I've posted an example of one possible solution in this gist:
https://gist.github.com/PaulC91/2a1b9ba57a53869ba82093720a9a8fa0
It requires a bit of a javascript hack to get the logout module button up up in the navbar.
Also, all of the menu tabs will be visible prior to login which isn't ideal but you can ensure none of their content is rendered until after a successful login by using req(credentials()$user_auth)
inside all the outputs.
You can hide and show UI with shinyJS. This works to only show the login page until you've logged in.
https://gist.github.com/GrayAlex49/7631d53af63c9533b70c3bbd48d3584e
Full navbarPage example now in inst/shiny-examples/navbarPage.
You can launch it locally with shinyauthr::runNavbarPageExample()
How would I go about using Shinyauthr with UI elements such as navbarPage, navbarMenu, and tabPanel.
placing the shinyauthr::loginUI between any of these shiny pages, menus, and panels results in nonfunctional outputs.
I've also tried storing the ui in a renderUI function, but the navbarPage does not appear. Is Shinyauthr able to work with these shiny elements, is there a possible workaround?