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

[11.x] add optional prefix for cache key #53448

Merged
merged 2 commits into from
Nov 9, 2024

Conversation

browner12
Copy link
Contributor

if a user does not decide to use a dedicated cache store for their password resets, there's a risk of collision/overwriting of the cache keys in the default cache store, since we are just using the user's email. this allows the user to set an optional config value to use a prefix on the cache key.

I left the default blank to start, but we could also choose to come up with some default string.

the other option to this PR is to force people to use a dedicated cache store, which I think we should at least strongly encourage for other reasons as well.

if a user does not decide to use a dedicated cache store for their password resets, there's a risk of collision/overwriting of the cache keys in the default cache store, since we are just using the user's email.  this allows the user to set an optional config value to use a prefix on the cache key.
@taylorotwell taylorotwell merged commit f405bf0 into laravel:11.x Nov 9, 2024
31 checks passed
@taylorotwell
Copy link
Member

Would it not be a bit easier to just put them in the cache as something like password-reset-.sha1($email)?

@browner12
Copy link
Contributor Author

having some low-collision chance default seems fine to me

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