diff --git a/LeaderboardBackend/Controllers/AccountController.cs b/LeaderboardBackend/Controllers/AccountController.cs index def0e517..8a1a3712 100644 --- a/LeaderboardBackend/Controllers/AccountController.cs +++ b/LeaderboardBackend/Controllers/AccountController.cs @@ -181,6 +181,7 @@ [FromServices] IAccountConfirmationService confirmationService [HttpPost("recover")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] + [FeatureGate(Features.ACCOUNT_RECOVERY)] public async Task RecoverAccount( [FromServices] IAccountRecoveryService recoveryService, [FromBody] RecoverAccountRequest request @@ -235,6 +236,7 @@ public async Task ConfirmAccount(Guid id, [FromServices] IAccountC [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] [ProducesResponseType(StatusCodes.Status404NotFound)] + [FeatureGate(Features.ACCOUNT_RECOVERY)] public async Task TestRecovery(Guid id, [FromServices] IAccountRecoveryService recoveryService) { TestRecoveryResult result = await recoveryService.TestRecovery(id); @@ -270,6 +272,7 @@ public async Task TestRecovery(Guid id, [FromServices] IAccountRec [ProducesResponseType(StatusCodes.Status404NotFound)] [ProducesResponseType(StatusCodes.Status409Conflict)] [ProducesResponseType(StatusCodes.Status422UnprocessableEntity, Type = typeof(ValidationProblemDetails))] + [FeatureGate(Features.ACCOUNT_RECOVERY)] public async Task ResetPassword( Guid id, [FromBody] ChangePasswordRequest request, diff --git a/LeaderboardBackend/Features.cs b/LeaderboardBackend/Features.cs index 348aec4f..c2f2e039 100644 --- a/LeaderboardBackend/Features.cs +++ b/LeaderboardBackend/Features.cs @@ -2,6 +2,7 @@ namespace LeaderboardBackend; public static class Features { + public const string ACCOUNT_RECOVERY = "AccountRecovery"; public const string ACCOUNT_REGISTRATION = "AccountRegistration"; public const string LOGIN = "Login"; } diff --git a/LeaderboardBackend/appsettings.json b/LeaderboardBackend/appsettings.json index 0e26077b..66d59a27 100644 --- a/LeaderboardBackend/appsettings.json +++ b/LeaderboardBackend/appsettings.json @@ -12,6 +12,7 @@ "SenderAddress": "no-reply@leaderboards.gg" }, "Feature": { + "AccountRecovery": true, "AccountRegistration": true, "Login": true }