New admin setting to redirect unauthorized guests to login provider
When the administrator has chosen to bypass the login screen, this change will take an unauthorized guest user to the login provider for any link, not just the home page. This should provide a solution for several feedback items, such as:
https://feedback.js.wiki/wiki/p/bypass-login-screen-option-should-apply-to-deep-links (mine! 😄) https://feedback.js.wiki/wiki/p/login-auto-redirect https://feedback.js.wiki/wiki/p/skip-unauthorized-screen-for-private-wikis
Steps to recreate (in a dev instance):
- Create a
/subpageas a secondary page (in addition to the homepage) - Remove all read access to guests in the admin section
- Choose "Bypass Login Screen" in the Security area of the admin section
- Log out (or open a private browsing window)
- Navigate directly to the newly created
/subpage-- it should send you to the login screen instead of returning an 'Unauthorized' error.
If there's a different way you'd prefer this implemented, I'm happy to help!
That's not what WIKI.config.auth.autoLogin is for and using it for this purpose would be an unexpected behavior. A new setting specific to this feature would be better suited.
Thanks @NGPixel, your comment makes complete sense. The above commits add a new admin switch to enable this functionality (as you suggested). However, there's currently no label or hint in the v-switch (I've moved and commented them out) because without those properties present in the localization config the switch doesn't work (but it does work with them moved out of the way).
I've also submitted a PR to the localization project to add the suggested label and hint properties.
Thanks!
Hello! Just checking in on this -- let me know if there's anything I can do to help with the review. Thanks!
FYI this sounds very like a PR I put in a couple of years back #3786 which was never approved.. if this is approved then that PR should be closed/rejected