Skip to content

[12.x] remove the "prefix" option for cache password resets #56127

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

Merged

Conversation

browner12
Copy link
Contributor

this is mostly a rollback of #53448 per Taylor's request. rather than allowing an optional prefix, we'll use a deterministic hash of the user's email for our cache key. this should make the chance of a collision if no dedicated store is used statistically insignificant.

I've also opted to extract out a makeCacheKey() method here mainly to reduce the duplicated code and help prevent bugs from divergence. however, this could possibly help userland override the cache key generation. maybe I'm overthinking that, maybe it's honestly not a problem.

Please be aware that this change on a minor or patch release will technically break existing users of cache password resets. However, it will likely be very short lived due to password resets usually only being valid for 60 minutes. Also, we have never documented the feature, so adoption is probably very low.

Taylor, I think this is what you were asking for in laravel/docs#10032 (comment), lmk if I was understanding correctly.

this is mostly a rollback of laravel#53448 per Taylor's request. rather than allowing an optional prefix, we'll use a deterministic hash of the user's email for our cache key.  this should make the chance of a collision if no dedicated store is used statistically insignificant.

I've also opted to extract out a `makeCacheKey()` method here mainly to reduce the duplicated code and help prevent bugs from divergence. however, this could possibly help userland override the cache key generation. maybe I'm overthinking that, maybe it's honestly not a problem.
@taylorotwell taylorotwell merged commit c895495 into laravel:12.x Jun 25, 2025
46 of 60 checks passed
@browner12 browner12 deleted the AB-remove-cache-token-repository-prefix branch June 25, 2025 13:28
mohammad-fouladgar pushed a commit to mohammad-fouladgar/framework that referenced this pull request Jul 22, 2025
…56127)

* remove the "prefix" option for cache password resets

this is mostly a rollback of laravel#53448 per Taylor's request. rather than allowing an optional prefix, we'll use a deterministic hash of the user's email for our cache key.  this should make the chance of a collision if no dedicated store is used statistically insignificant.

I've also opted to extract out a `makeCacheKey()` method here mainly to reduce the duplicated code and help prevent bugs from divergence. however, this could possibly help userland override the cache key generation. maybe I'm overthinking that, maybe it's honestly not a problem.

* formatting

---------

Co-authored-by: Taylor Otwell <[email protected]>
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