Merge pull request #594 from Ferks-FK/dev

Fixes user email verification
This commit is contained in:
Dennis 2022-11-03 20:43:54 +01:00 committed by GitHub
commit 7e7e454ad6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 2 deletions

1
.gitignore vendored
View file

@ -15,6 +15,7 @@ Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
yarn.lock
.gitignore
.env.dev
.env.testing

View file

@ -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'));
}

View file

@ -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();
}
}

View file

@ -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">