From 19e6d8575f853a6060ba2b07c45d6f01ef84ae2d Mon Sep 17 00:00:00 2001 From: printempw Date: Thu, 26 Jul 2018 18:22:21 +0800 Subject: [PATCH] Require verification after changing email --- app/Http/Controllers/UserController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 54cc2357..4a2881b5 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -208,6 +208,11 @@ class UserController extends Controller return json(trans('user.profile.email.wrong-password'), 1); if ($this->user->setEmail($request->input('new_email'))) { + // Set account status to unverified + $this->user->verified = false; + $this->user->verification_token = ''; + $this->user->save(); + event(new UserProfileUpdated($action, $this->user)); return json(trans('user.profile.email.success'), 0)