Repository navigation
Conversation
There was a problem hiding this comment.
馃煝 Approval recommended
No unresolved review issues were identified.
Pull request overview
Removes the unused leafs/http dependency from leafs/auth.
Changes:
- Deletes
leafs/httpfrom Composer requirements. - Retains other authentication dependencies.
File summaries
| File | Summary |
|---|---|
composer.json |
Removes the unnecessary HTTP dependency. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
mychidarko
left a comment
There was a problem hiding this comment.
leafs/http isn't unused yet. Leaf\Http\Session comes from leafs/session, so that part is fine, but Auth::logout($url) calls response()->redirect() outside the class_exists('Leaf\App') guard. Without leafs/http, standalone (non-Leaf) users calling logout('/somewhere') would hit an undefined function. Could you either keep the dependency, or fall back to a plain header('Location: ...') when response() doesn't exist?
|
It is better to add the class_exists conditional, because the behavior of location: / is different from redirect('/') I think leafs/http adds the base_url but location does not |
|
Sounds good 馃憣馃徑 |
Add a check for function_exists('response') before calling it to prevent
fatal errors in environments where the helper is not available.
What kind of change does this PR introduce? (pls check at least one)
Developers using
leafs/authwithoutleafs/leafare still installingleafs/httpunnecessarily, the Request, Response and Pages objects are only used if the developer hasleafs/leafinstalled.This pull request is part of a series of cleanups made by me to reduce the size of the
leafs/authpackage and reduce installation timesDescription
This pull request makes a minor update to the project's dependencies by removing the
leafs/httppackage fromcomposer.json. This change reduces unused or unnecessary dependencies in the project.Does this PR introduce a breaking change? (check one)
This change will only break projects that use
leafs/httpwithout requiring it incomposer.json, relying on it being included withleafs/auth.If this pull request manages to be integrated into version 5, developers should be notified that
leafs/authno longer includesleafs/http, so if you use that package in your projects, add it to therequires ofcomposer.json