Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x] Fix unauthorized page logout redirect #10378

Merged
merged 3 commits into from
Jul 1, 2024
Merged

[5.x] Fix unauthorized page logout redirect #10378

merged 3 commits into from
Jul 1, 2024

Conversation

bensherred
Copy link
Contributor

Following the release of v5.12.0, developers can now disable the CP authentication pages. However, if a user is unauthorized to access the control panel, an unexpected exception is thrown.

This is due to the unauthorized view attempting to use the login route as the redirect after logging out, however, that route will no longer be registered if CP authentication is disabled.

Therefore, to solve this, I've added a check in the UnauthorizedController to check whether the CP authentication pages are enabled. If they are, we will redirect to the login page after logout, otherwise, we will redirect back to URL specified in the config.

@jasonvarga jasonvarga merged commit cfbe3eb into statamic:5.x Jul 1, 2024
16 checks passed
@bensherred bensherred deleted the bugfix/unauthorized-redirect branch July 1, 2024 15:19
@bensherred
Copy link
Contributor Author

Thanks for fixing those small bits @jasonvarga 🙌🏼

@jasonvarga
Copy link
Member

No worries, thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants