Commit 9f93e151 by Burton Committed by GitHub

Hash password only once

When a user resets their password, the password would be double hashed and the user locked out of their account.

Ensure we only hash the password if it needs to be hashed. If it has already been hashed, just return the password as-is.
1 parent a8e0d42a
Showing with 1 additions and 1 deletions
...@@ -32,7 +32,7 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac ...@@ -32,7 +32,7 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
public function setPasswordAttribute($password) public function setPasswordAttribute($password)
{ {
$this->attributes['password'] = Hash::make($password); $this->attributes['password'] = Hash::needsRehash($password) ? Hash::make($password) : $password;
} }
public function photoUrl(array $attributes) public function photoUrl(array $attributes)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!