Commit 029ca7e
committed
minor symfony#53201 [Security] Reduce log level in case of UserNotFoundException in ContextListener (VincentLanglet)
This PR was merged into the 7.1 branch.
Discussion
----------
[Security] Reduce log level in case of UserNotFoundException in ContextListener
| Q | A
| ------------- | ---
| Branch? | 7.1
| Bug fix? | no
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Issues | Fix symfony#50402
| License | MIT
I didn't get a clear answer for symfony#50402 so I'm opening a PR about the suggested change to get opinion on it.
There was a similar discussion, some message which could help:
- `@fabpot` symfony#1073 (comment)
- `@stof` symfony#1073 (comment)
Here, the `UserNotFoundException` should be considered as a "normal" behavior to me. You can trigger it this way
- Connect yourself with an account.
- Ask someone else to deleted you account on an admin panel.
- Refresh the page, since your account doesn't exist anymore, the Provider doesn't find your user, throw a NotFoundException
- You're logged out
I consider this as a normal behavior, so no warning shouldn't be logged and an info should be preferred.
It's expected to not found a user after this one being deleted.
That seems to be one of the purpose of the refreshUser method to returns null:
- If the user changed
- If the user doesn't exist
WDYT ?
Commits
-------
deed930 Reduce log levelFile tree
1 file changed
+1
-1
lines changed- src/Symfony/Component/Security/Http/Firewall
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
| 237 | + | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| |||
0 commit comments