From 0c6d1c9bfb0a72447cb0ecdce4dddfc309b4a18d Mon Sep 17 00:00:00 2001 From: nikita Date: Thu, 26 Dec 2024 16:16:33 +0300 Subject: [PATCH] refactor: compact two factor auth --- Endpoint/Controllers/V1/AuthController.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Endpoint/Controllers/V1/AuthController.cs b/Endpoint/Controllers/V1/AuthController.cs index 544533d..2b01b54 100644 --- a/Endpoint/Controllers/V1/AuthController.cs +++ b/Endpoint/Controllers/V1/AuthController.cs @@ -253,11 +253,8 @@ public class AuthController(IOptionsSnapshot user, IOptionsSnapshotA boolean indicating whether the two-factor authentication was successful. [HttpPost("2FA")] [BadRequestResponse] - public async Task> TwoFactorAuth([FromBody] TwoFactorAuthRequest request) - { - var tokenResult = await auth.LoginAsync(GetCookieParams(), HttpContext, request.Method.ConvertFromDto(), request.Code); - return Ok(tokenResult); - } + public async Task> TwoFactorAuth([FromBody] TwoFactorAuthRequest request) => + await auth.LoginAsync(GetCookieParams(), HttpContext, request.Method.ConvertFromDto(), request.Code); /// /// Refreshes the authentication token using the existing refresh token.