[6.x] Front-end login route#19220
Open
brianjhanson wants to merge 13 commits into
Open
Conversation
You were previously unable to delete the "home" route becuase `uriParts` was not on the `$route` variable
riasvdv
reviewed
Jul 7, 2026
riasvdv
approved these changes
Jul 7, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR exposes a front-end POST route at the configured loginPath (when front-end user routes are enabled), adjusts logout redirect behavior to consistently honor postLogoutRedirect (defaulting to the site root), and hardens route deletion event payloads when a route is missing uriParts.
Changes:
- Add
POSTrouting for front-end logins atloginPath. - Fix logout redirects to use
postLogoutRedirect(or site root) rather than falling back toback(). - Prevent errors when deleting routes that don’t have
uriPartsset, and add feature tests for logout redirect behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
routes/web.php |
Registers a new POST route for loginPath to support front-end login form submissions. |
src/Http/Controllers/Auth/LoginController.php |
Updates non-JSON logout responses to redirect to the site URL for postLogoutRedirect. |
tests/Feature/Http/Controllers/Auth/LoginControllerTest.php |
Adds tests ensuring logout redirects don’t fall back to the referrer and honor configured redirects. |
src/Route/Routes.php |
Makes route deletion events resilient when uriParts is missing in project config data. |
This reverts commit 43a82bb.
[6.x] Fix localized site routes
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exposes a
POSTto yourloginPathsetting when front-end registration is enabled. Front-end login forms should post to that path to attempt a log in.This also fixed some odd behavior I saw when logging out where I was getting redirected back to the previous page instead of dumped on the homepage (as was the case in Craft 5).
Fixes a lil' bug with deleting the home route from the UI that I noticed along the way