wiki icon indicating copy to clipboard operation
wiki copied to clipboard

New admin setting to redirect unauthorized guests to login provider

Open pofallon opened this issue 2 years ago • 6 comments

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):

  1. Create a /subpage as a secondary page (in addition to the homepage)
  2. Remove all read access to guests in the admin section
  3. Choose "Bypass Login Screen" in the Security area of the admin section
  4. Log out (or open a private browsing window)
  5. 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!

pofallon avatar Apr 10 '23 02:04 pofallon

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.

NGPixel avatar May 04 '23 19:05 NGPixel

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!

pofallon avatar May 08 '23 01:05 pofallon

Hello! Just checking in on this -- let me know if there's anything I can do to help with the review. Thanks!

pofallon avatar Jun 16 '23 14:06 pofallon

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

PaulD987 avatar Jul 14 '23 13:07 PaulD987