Skip to content

Commit

Permalink
fix: validate email address on password change
Browse files Browse the repository at this point in the history
  • Loading branch information
kumy committed Nov 17, 2023
1 parent 00376b9 commit 206e1ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use GeoKrety\Email\EmailChange;
use GeoKrety\Model\EmailActivationToken;
use GeoKrety\Model\User;
use GeoKrety\Service\Smarty;
use Sugar\Event;

Expand Down Expand Up @@ -89,7 +90,7 @@ public function accept(\Base $f3) {

// Save the new email
$this->token->user->set_email($this->token->email);
$this->token->user->email_invalid = 0;
$this->token->user->email_invalid = User::USER_EMAIL_NO_ERROR;

if (!$this->token->user->validate()) {
$this->get($f3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function post(\Base $f3) {

// Save new password
$user->password = $password_new;
$user->email_invalid = User::USER_EMAIL_NO_ERROR;
if ($user->validate()) {
$user->save();

Expand Down

0 comments on commit 206e1ec

Please sign in to comment.