mirror of
https://github.com/flarum/framework.git
synced 2024-11-30 21:44:12 +08:00
Always invalidate all user email tokens
Reported by B. Dhiyaneshwaran of Geek Freak.
This commit is contained in:
parent
546b4f01ac
commit
66607a5674
|
@ -53,7 +53,8 @@ class ConfirmEmailHandler
|
|||
$user->save();
|
||||
$this->dispatchEventsFor($user);
|
||||
|
||||
$token->delete();
|
||||
// Delete *all* tokens for the user, in case other ones were sent first
|
||||
$user->emailTokens()->delete();
|
||||
|
||||
return $user;
|
||||
}
|
||||
|
|
|
@ -614,6 +614,16 @@ class User extends AbstractModel
|
|||
return $this->hasMany('Flarum\Notification\Notification');
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the relationship with the user's email tokens.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function emailTokens()
|
||||
{
|
||||
return $this->hasMany(EmailToken::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the relationship with the permissions of all of the groups that
|
||||
* the user is in.
|
||||
|
|
Loading…
Reference in New Issue
Block a user