wiki icon indicating copy to clipboard operation
wiki copied to clipboard

Optionally always redirect user to login page if they are not authenticated fixes #3744

Open PaulD987 opened this issue 4 years ago • 0 comments

If a wiki is configured to be private, eg guest does not have any permissions to view any of the pages on the wiki, it is an annoyance to always be told that you aren't authorized to view a page when you aren't logged in. A more natural flow in this sort of scenario would be to be automatically directed to the login page so that the user can authenticate (and then hopefully gain access to the page).

This change adds a configuration option to the security page to enable "Bypass Unauthorized Screen" functionality. This option defaults to false, so there is no change in behavior for existing/new installations, it is an opt-in configuration change.

Two new translatable strings are required:

"admin:security.bypassUnauthorized": "Bypass Unauthorized Screen"
"admin:security.bypassUnauthorizedHint": "Should the user be redirected automatically to the login screen if they are not authenticated and attempt to access a page not accessible to Guest"

image

I have tested various scenarios here when trying to access a page that Guest is not authorised to: db doesn't have config option set at all - Unauthorised page shown db has config option set to false - Unauthorized page shown db has config option set to true - Redirected to login page automatically

new strings have been tested in a dev en.yml file.

PaulD987 avatar Mar 30 '21 16:03 PaulD987