8000 [11.x] Use `Date` facade for storing the password confirmation timestamp by crynobone · Pull Request #54383 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content

[11.x] Use Date facade for storing the password confirmation timestamp #54383

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
merged 1 commit into from
Jan 28, 2025

Conversation

crynobone
Copy link
Member
@crynobone crynobone commented Jan 28, 2025

This matches the changes via laravel/fortify#520


Problem

Currently, the password confirmation endpoint uses PHP's inbuilt time() function. This does not consider freezeSecond() or Date::setTestNow(). Leading to inconsistent results during tests.

Solution

This update maintains compatibility with existing features as both time() and ->unix() return a UNIX timestamp.

This matches the changes via laravel/fortify#520

--------------

Currently, the password confirmation endpoint uses PHP's inbuilt `time()` function. This does not consider `freezeSecond()` or `Date::setTestNow()`. Leading to inconsistent results during tests.

This update maintains compatibility with existing features as both `time()` and `->unix()` return a UNIX timestamp.

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
@crynobone crynobone marked this pull request as ready for review January 28, 2025 02:42
@@ -6,6 +6,7 @@
use Illuminate\Contracts\Session\Session;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Date;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already been used in illuminate/session so adding this should be safe.

@taylorotwell taylorotwell merged commit 33a882d into 11.x Jan 28, 2025
41 checks passed
@taylorotwell taylorotwell deleted the 11/use-carbon-on-password-confirmed branch January 28, 2025 15:20
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.

3 participants
0