mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-26 15:08:39 +00:00
Prevent access to GameServer features if email enforcement is enabled and email is unverified
This commit is contained in:
parent
fbe3ceec7c
commit
9e9c96e1a3
3 changed files with 36 additions and 0 deletions
|
@ -25,6 +25,8 @@ public class MatchController : ControllerBase
|
|||
{
|
||||
private readonly DatabaseContext database;
|
||||
|
||||
private static readonly bool emailEnforcementEnabled = EnforceEmailConfiguration.Instance.EnableEmailEnforcement;
|
||||
|
||||
public MatchController(DatabaseContext database)
|
||||
{
|
||||
this.database = database;
|
||||
|
@ -43,6 +45,8 @@ public class MatchController : ControllerBase
|
|||
UserEntity? user = await this.database.UserFromGameToken(token);
|
||||
if (user == null) return this.Forbid();
|
||||
|
||||
if (emailEnforcementEnabled && !user.EmailAddressVerified) return this.BadRequest();
|
||||
|
||||
await LastContactHelper.SetLastContact(this.database, user, token.GameVersion, token.Platform);
|
||||
|
||||
// Do not allow matchmaking if it has been disabled
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue