mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-26 15:08:39 +00:00
Slight refactor and finish enforcement on endpoints
This commit is contained in:
parent
5bdb1c0501
commit
f6cbafd524
7 changed files with 78 additions and 35 deletions
|
@ -24,8 +24,6 @@ public class EnterLevelController : ControllerBase
|
|||
{
|
||||
private readonly DatabaseContext database;
|
||||
|
||||
private static readonly bool emailEnforcementEnabled = EnforceEmailConfiguration.Instance.EnableEmailEnforcement;
|
||||
|
||||
public EnterLevelController(DatabaseContext database)
|
||||
{
|
||||
this.database = database;
|
||||
|
@ -41,9 +39,6 @@ public class EnterLevelController : ControllerBase
|
|||
|
||||
if (SlotHelper.IsTypeInvalid(slotType)) return this.BadRequest();
|
||||
|
||||
// Return bad request on unverified email if enforcement is enabled
|
||||
if (emailEnforcementEnabled && !user.EmailAddressVerified) return this.BadRequest();
|
||||
|
||||
// don't count plays for developer slots
|
||||
if (slotType == "developer") return this.Ok();
|
||||
|
||||
|
@ -117,9 +112,6 @@ public class EnterLevelController : ControllerBase
|
|||
|
||||
if (SlotHelper.IsTypeInvalid(slotType)) return this.BadRequest();
|
||||
|
||||
// Return bad request on unverified email if enforcement is enabled
|
||||
if (emailEnforcementEnabled && !user.EmailAddressVerified) return this.BadRequest();
|
||||
|
||||
if (slotType == "developer") return this.Ok();
|
||||
|
||||
SlotEntity? slot = await this.database.Slots.FirstOrDefaultAsync(s => s.SlotId == slotId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue