Skip to content

Commit 10e3948

Browse files
author
Pascal Baljet
committed
Clear before creating new one
1 parent aa22e2f commit 10e3948

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to `laravel-user-email` will be documented in this file
44

5+
## 1.0.5 - 2020-01-05
6+
7+
- refactoring
8+
59
## 1.0.4 - 2020-01-05
610

711
- publishes the migration only once

src/MustVerifyNewEmail.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ trait MustVerifyNewEmail
1818
*/
1919
public function newEmail(string $email):?PendingUserEmail
2020
{
21-
$this->clearPendingEmail();
22-
2321
if ($this->getEmailForVerification() === $email && $this->hasVerifiedEmail()) {
2422
return null;
2523
}
@@ -37,6 +35,8 @@ public function newEmail(string $email):?PendingUserEmail
3735
*/
3836
public function createPendingUserEmailModel(string $email): PendingUserEmail
3937
{
38+
$this->clearPendingEmail();
39+
4040
return PendingUserEmail::create([
4141
'user_type' => get_class($this),
4242
'user_id' => $this->getKey(),

0 commit comments

Comments
 (0)