Skip to content

Commit

Permalink
Add an extra check here
Browse files Browse the repository at this point in the history
  • Loading branch information
daftspunk committed Oct 2, 2017
1 parent a9c5c87 commit 90ad8c8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Auth/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,9 @@ public function getActivationCode()
*/
public function attemptActivation($activationCode)
{
if ($this->is_activated)
if ($this->is_activated) {
throw new Exception('User is already active!');
}

if ($activationCode == $this->activation_code) {
$this->activation_code = null;
Expand Down Expand Up @@ -269,6 +270,10 @@ public function getResetPasswordCode()
*/
public function checkResetPasswordCode($resetCode)
{
if (!$resetCode || !$this->reset_password_code) {
return false;
}

return ($this->reset_password_code == $resetCode);
}

Expand Down

0 comments on commit 90ad8c8

Please sign in to comment.