mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-26 15:08:39 +00:00
Move everything into middleware
This commit is contained in:
parent
a322a32b38
commit
561e1d4e26
8 changed files with 93 additions and 62 deletions
|
@ -25,8 +25,6 @@ public class MatchController : ControllerBase
|
|||
{
|
||||
private readonly DatabaseContext database;
|
||||
|
||||
private static readonly bool emailEnforcementEnabled = EnforceEmailConfiguration.Instance.EnableEmailEnforcement;
|
||||
|
||||
public MatchController(DatabaseContext database)
|
||||
{
|
||||
this.database = database;
|
||||
|
@ -44,9 +42,6 @@ public class MatchController : ControllerBase
|
|||
UserEntity? user = await this.database.UserFromGameToken(token);
|
||||
if (user == null) return this.Unauthorized();
|
||||
|
||||
// Return bad request on unverified email if enforcement is enabled
|
||||
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