Skip to content

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

Merged
taylorotwell merged 1 commit into
11.xfrom
11/use-carbon-on-password-confirmed
Jan 28, 2025
Merged

[11.x] Use Date facade for storing the password confirmation timestamp#54383
taylorotwell merged 1 commit into
11.xfrom
11/use-carbon-on-password-confirmed

Conversation

@crynobone
Copy link
Copy Markdown
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
use Illuminate\Contracts\Session\Session;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Date;
Copy link
Copy Markdown
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
@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