mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-05 11:28:39 +00:00
Check if email token belongs to a user before verifying the email
This commit is contained in:
parent
b129ec1ab1
commit
96e739a8fe
1 changed files with 6 additions and 0 deletions
|
@ -28,6 +28,12 @@ public class CompleteEmailVerificationPage : BaseLayout
|
|||
return this.Page();
|
||||
}
|
||||
|
||||
if (emailVerifyToken.UserId != user.UserId)
|
||||
{
|
||||
this.Error = "This token doesn't belong to you!";
|
||||
return this.Page();
|
||||
}
|
||||
|
||||
this.Database.EmailVerificationTokens.Remove(emailVerifyToken);
|
||||
|
||||
user.EmailAddressVerified = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue