Closed mrinmayik closed 2 years ago
Hi there,
So in this case you have to integrate the shinyauthr login panel shinyauthr::loginUI(id = "login")
and logout button shinyauthr::logoutUI(id = "logout")
inside the shinydashboard dashboardPage()
UI, otherwise you will have 2 separate UI pages as you see above.
You can take a look at example code using shinyauthr with shinydashboard here and see this app in action by running shinyauthr::runExample("shinydashboard")
In your case, you will need to use sidebarMenuOutput()
and uiOutput()
for your sidebar and tab items in the UI and then render them in the server function only when a successful login happens with renderMenu()
and renderUI()
.
If you run into any more issues it's best to ask for help on stackoverflow or RStudio Community (unless it's an obvious bug in the package) as you'll most likely get an answer very quickly and more people can benefit from the more visible discussion.
Good luck!
Hi Paul,
Thanks a lot for this package! I'm very new to RShiny, and have made a very simple app without reactive elements. I'm trying to add a login screen to the app using shinyauthr based on the example on the README page on Github. The login dialog box and logout button show up as expected. But for some reason, the rest of the app shows below the login dialog box even if the user is not logged in (see attached images).
Here's a short app to demonstrate the problem. Like this example, my app does not have any reactive elements that are displayed through the server function. So my server function is empty except for the lines required for shinyauthr.
Any suggestions on how to fix this?
Thank you, Mrinmayi