Registration, Login controllers are misleading
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
These are located in the forum namespace, but return a JSON-formatted response (and JSON-formatted validation errors). However, the error handler for their pipeline uses the View/Whoops formatter, so if they run into issues, errors will be returned in a way unexpected by the frontend.
- https://github.com/flarum/core/blob/efa9d38d73d5faf18b9f47eef6603e2e1dc45527/src/Forum/Controller/LogInController.php#L90-L90
- https://github.com/flarum/core/blob/efa9d38d73d5faf18b9f47eef6603e2e1dc45527/src/Forum/Controller/RegisterController.php#L71-L71
We should refactor these so that either:
- We can override the error formatter per-route.
Contributor guide
Research direction
Start with the referenced lines in src/Forum/Controller/LogInController.php and src/Forum/Controller/RegisterController.php, then trace the error handler used by their route pipeline. Done means choosing and implementing a consistent way for these JSON responses and validation errors to use an appropriate formatter, but the issue does not specify the complete design.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100