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

[5.2] Use Carbon for everything time related in DatabaseTokenRepository #13234

Merged
merged 2 commits into from
Apr 21, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,9 @@ public function exists(CanResetPasswordContract $user, $token)
*/
protected function tokenExpired($token)
{
$expirationTime = strtotime($token['created_at']) + $this->expires;
$expiresAt = Carbon::parse($token['created_at'])->addSeconds($this->expires);

return $expirationTime < $this->getCurrentTime();
}

/**
* Get the current UNIX timestamp.
*
* @return int
*/
protected function getCurrentTime()
{
return time();
return $expiresAt->isPast();
}

/**
Expand Down