mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 23:23:52 +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();
|
$user->save();
|
||||||
$this->dispatchEventsFor($user);
|
$this->dispatchEventsFor($user);
|
||||||
|
|
||||||
$token->delete();
|
// Delete *all* tokens for the user, in case other ones were sent first
|
||||||
|
$user->emailTokens()->delete();
|
||||||
|
|
||||||
return $user;
|
return $user;
|
||||||
}
|
}
|
||||||
|
|
|
@ -614,6 +614,16 @@ class User extends AbstractModel
|
||||||
return $this->hasMany('Flarum\Notification\Notification');
|
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
|
* Define the relationship with the permissions of all of the groups that
|
||||||
* the user is in.
|
* the user is in.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user