Uh oh!
There was an error while loading. Please reload this page.
[5.x] Ability to disable CP authentication - #8960
Conversation
Even when CP Auth has been disabled
# Conflicts: # routes/cp.php
Uh oh!
There was an error while loading. Please reload this page.
DwainsWorld
commented
Feb 18, 2024
Is this planned for 4.X? We would use this in almost all our apps that have a Statamic installation. |
duncanmcclean
commented
Feb 18, 2024
Sorry, we don't have an ETA for reviewing/merging this pull request. We'll get to it when we can. In the meantime, you can pull this PR into your project with a composer patch. |
DwainsWorld
commented
Feb 18, 2024
No problem. Thanks for the update and the composer patch package link - very useful! |
DwainsWorld
commented
Feb 24, 2024
I was giving this a try with composer patch, all went well. Except, within Shouldn't this: Be: |
duncanmcclean
commented
Feb 24, 2024
@DwainsWorld Yes, it should be, thanks! I've updated this PR. |
edalzell
commented
Mar 25, 2024
This works great for me, thanks Duncan! |
Uh oh!
There was an error while loading. Please reload this page.
edalzell
commented
May 9, 2024
Yes, I've run into this. This flow needs to be reconsidered when CP login is disabled. We use it in a passwordless login situation so this part makes no sense, it should log out and redirect to the appropriate page. |
# Conflicts: # tests/Tags/User/ForgotPasswordFormTest.php # tests/Tags/User/LoginFormTest.php # tests/Tags/User/PasswordFormTest.php # tests/Tags/User/RegisterFormTest.php
Instead, redirect when there's an actual 401. Apparently it's not completely accurate. You could get a few requests that return zero. It's fine for controlling when the modal pops up, but not a redirect. If you redirect, when you hit the login page your session will be extended, keeping you logged in.
* Allow configuring the Stache's Cache Store Related: statamic/cms#10303 * Ability to disable CP authentication Related: statamic/cms#8960 * Display custom logo as plain text Related: statamic/cms#10350 * Track sites.yaml path in git integration config Related: statamic/cms#10463 * Add ability to specify the queue connection on static:warm command Related: statamic/cms#8634


This pull request implements a new config option, allowing developers to disable the Control Panel authentication pages.
Often times, if you're using something like Jetstream or Laravel Nova which provide their own login pages then you don't want an additional login page for users to somehow find their way to.
Authentication can be disabled by toggling the
statamic.cp.auth.enabledoption. You may optionally specify a URL for users to be redirected to instead:This PR replaces my previous PR, #7617.