Skip to content

Commit 44865e2

Browse files
authored
Merge pull request #96 from fefo-p/nullify-reset-vars
Set reset* variables to null after password change
2 parents 4152cd6 + 6a2c9d7 commit 44865e2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Entities/User.php

+13
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,19 @@ public function setPassword(string $password)
6767
$config->hashAlgorithm,
6868
$hashOptions
6969
);
70+
71+
/*
72+
Set these vars to null in case a reset password was asked.
73+
Scenario:
74+
user (a *dumb* one with short memory) requests a
75+
reset-token and then does nothing => asks the
76+
administrator to reset his password.
77+
User would have a new password but still anyone with the
78+
reset-token would be able to change the password.
79+
*/
80+
$this->attributes['reset_hash'] = null;
81+
$this->attributes['reset_time'] = null;
82+
$this->attributes['reset_start_time'] = null;
7083
}
7184

7285
/**

0 commit comments

Comments
 (0)