Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account Recovery Feature Flag #202

Merged
merged 3 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions LeaderboardBackend/Controllers/AccountController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ [FromServices] IAccountConfirmationService confirmationService
[HttpPost("recover")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[FeatureGate(Features.ACCOUNT_RECOVERY)]
public async Task<ActionResult> RecoverAccount(
[FromServices] IAccountRecoveryService recoveryService,
[FromBody] RecoverAccountRequest request
Expand Down Expand Up @@ -235,6 +236,7 @@ public async Task<ActionResult> ConfirmAccount(Guid id, [FromServices] IAccountC
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[FeatureGate(Features.ACCOUNT_RECOVERY)]
public async Task<ActionResult> TestRecovery(Guid id, [FromServices] IAccountRecoveryService recoveryService)
{
TestRecoveryResult result = await recoveryService.TestRecovery(id);
Expand Down Expand Up @@ -270,6 +272,7 @@ public async Task<ActionResult> TestRecovery(Guid id, [FromServices] IAccountRec
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ProducesResponseType(StatusCodes.Status409Conflict)]
[ProducesResponseType(StatusCodes.Status422UnprocessableEntity, Type = typeof(ValidationProblemDetails))]
[FeatureGate(Features.ACCOUNT_RECOVERY)]
public async Task<ActionResult> ResetPassword(
Guid id,
[FromBody] ChangePasswordRequest request,
Expand Down
1 change: 1 addition & 0 deletions LeaderboardBackend/Features.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
1 change: 1 addition & 0 deletions LeaderboardBackend/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"SenderAddress": "[email protected]"
},
"Feature": {
"AccountRecovery": true,
"AccountRegistration": true,
"Login": true
}
Expand Down
Loading