We have a Shiny Server Pro setup in-house with a variety of different apps being hosted. When the user connect to the base URL or the URL of a specific app, they are asked to login via via the built-in authentication in shiny server pro (authenticating via auth_active_dir). However when they logout of an app they are always redirected back to the base URL of the Shiny Server. So for example after logging out of the app located at 'https://appsite.company.com/app1' they are redirected to the login page at 'https://appsite.company.com'.
Is there any way to control where the logout button redirects the user after logging them out? Ideally we would like the user to be redirected the the login page for the same app that they just logged out from.
The code for our logout button looks like this:
tags$a(
class = "btn btn-primary",
href = "__logout__",
role = "button",
"Sign out"
)
One possibility: modify the configuration file so that each app directory is served at its own location, as below:
# Define a server that listens on port 3838
server {
listen 3838;
location /app1 {
required_user *;
app_dir /srv/shiny-server/app1;
}
location /app2 {
required_user *;
app_dir /srv/shiny-server/app2;
}
}
Hitting the logout button on app1 will return you /app1 rather than the server root.