Skip to content

Commit 67b1b8b

Browse files
committed
Fix response MediaTypeNames
1 parent 9bfe8ea commit 67b1b8b

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

API/Controller/Account/Activate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public sealed partial class AccountController
1414
/// <response code="200"></response>
1515
[HttpPost("activate")]
1616
[ProducesResponseType(StatusCodes.Status200OK)]
17-
[ProducesResponseType<OpenShockProblem>(StatusCodes.Status403Forbidden, MediaTypeNames.Application.Json)]
17+
[ProducesResponseType<OpenShockProblem>(StatusCodes.Status403Forbidden, MediaTypeNames.Application.ProblemJson)]
1818
[MapToApiVersion("1")]
1919
public async Task<IActionResult> Activate([FromQuery(Name = "token")] string token, CancellationToken cancellationToken)
2020
{

API/Controller/Account/Authenticated/ChangePassword.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Microsoft.AspNetCore.Mvc;
33
using OpenShock.API.Models.Requests;
44
using OpenShock.Common.Errors;
5+
using OpenShock.Common.Problems;
56
using OpenShock.Common.Utils;
67

78
namespace OpenShock.API.Controller.Account.Authenticated;
@@ -17,6 +18,8 @@ public sealed partial class AuthenticatedAccountController
1718
[HttpPost("password")]
1819
[Consumes(MediaTypeNames.Application.Json)]
1920
[ProducesResponseType(StatusCodes.Status200OK)]
21+
[ProducesResponseType<OpenShockProblem>(StatusCodes.Status401Unauthorized, MediaTypeNames.Application.ProblemJson)]
22+
[ProducesResponseType<OpenShockProblem>(StatusCodes.Status403Forbidden, MediaTypeNames.Application.ProblemJson)]
2023
public async Task<IActionResult> ChangePassword([FromBody] ChangePasswordRequest body)
2124
{
2225
if (!string.IsNullOrEmpty(CurrentUser.PasswordHash) && !HashingUtils.VerifyPassword(body.CurrentPassword, CurrentUser.PasswordHash).Verified)

API/Controller/Account/PasswordResetInitiateV2.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public sealed partial class AccountController
2525
[EnableRateLimiting("auth")]
2626
[Consumes(MediaTypeNames.Application.Json)]
2727
[ProducesResponseType(StatusCodes.Status200OK)]
28-
[ProducesResponseType<OpenShockProblem>(StatusCodes.Status403Forbidden, MediaTypeNames.Application.Json)]
28+
[ProducesResponseType<OpenShockProblem>(StatusCodes.Status403Forbidden, MediaTypeNames.Application.ProblemJson)]
2929
[MapToApiVersion("2")]
3030
public async Task<IActionResult> PasswordResetInitiateV2([FromBody] PasswordResetRequestV2 body, [FromServices] ICloudflareTurnstileService turnstileService, CancellationToken cancellationToken)
3131
{

API/Controller/Account/VerifyEmail.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public sealed partial class AccountController
1414
/// <response code="200"></response>
1515
[HttpPost("verify-email")]
1616
[ProducesResponseType(StatusCodes.Status200OK)]
17-
[ProducesResponseType<OpenShockProblem>(StatusCodes.Status403Forbidden, MediaTypeNames.Application.Json)]
17+
[ProducesResponseType<OpenShockProblem>(StatusCodes.Status403Forbidden, MediaTypeNames.Application.ProblemJson)]
1818
[MapToApiVersion("1")]
1919
public async Task<IActionResult> EmailVerify([FromQuery(Name = "token")] string token, CancellationToken cancellationToken)
2020
{

0 commit comments

Comments
 (0)