Merge pull request #594 from Ferks-FK/dev
Fixes user email verification
This commit is contained in:
commit
7e7e454ad6
4 changed files with 14 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -15,6 +15,7 @@ Homestead.json
|
|||
Homestead.yaml
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
yarn.lock
|
||||
.gitignore
|
||||
.env.dev
|
||||
.env.testing
|
||||
|
|
|
@ -131,7 +131,11 @@ class ProfileController extends Controller
|
|||
'name' => $request->input('name'),
|
||||
'email' => $request->input('email'),
|
||||
]);
|
||||
$user->sendEmailVerificationNotification();
|
||||
|
||||
if ($request->input('email') != Auth::user()->email) {
|
||||
$user->reVerifyEmail();
|
||||
$user->sendEmailVerificationNotification();
|
||||
};
|
||||
|
||||
return redirect()->route('profile.index')->with('success', __('Profile updated'));
|
||||
}
|
||||
|
|
|
@ -266,4 +266,11 @@ class User extends Authenticatable implements MustVerifyEmail
|
|||
'email_verified_at' => now(),
|
||||
])->save();
|
||||
}
|
||||
|
||||
public function reVerifyEmail()
|
||||
{
|
||||
$this->forceFill([
|
||||
'email_verified_at' => null,
|
||||
])->save();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1{{__('Users')}}</h1>
|
||||
<h1>{{__('Users')}}</h1>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<ol class="breadcrumb float-sm-right">
|
||||
|
|
Loading…
Reference in a new issue