From 6831d9c7082649fdcf7008aa886b33388b3c85ef Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Sat, 2 Nov 2024 22:09:40 +0300 Subject: [PATCH] fix: return bool instead --- Endpoint/Controllers/V1/AuthController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Endpoint/Controllers/V1/AuthController.cs b/Endpoint/Controllers/V1/AuthController.cs index b1abe5a..dafe3b7 100644 --- a/Endpoint/Controllers/V1/AuthController.cs +++ b/Endpoint/Controllers/V1/AuthController.cs @@ -41,7 +41,7 @@ public class AuthController(IOptionsSnapshot user, AuthService auth, Pass GetCookieParams(), new User { - Id = 1, + Id = 1.ToString(), Username = userEntity.Username, Email = userEntity.Email, PasswordHash = userEntity.PasswordHash, @@ -56,10 +56,10 @@ public class AuthController(IOptionsSnapshot user, AuthService auth, Pass [HttpPost("2FA")] [BadRequestResponse] - public async Task> TwoFactorAuth([FromBody] TwoFactorAuthRequest request) + public async Task> TwoFactorAuth([FromBody] TwoFactorAuthRequest request) { var tokenResult = await auth.LoginAsync(GetCookieParams(), HttpContext, request.Method.ConvertFromDto(), request.Code); - return Ok(tokenResult ? TwoFactorAuthentication.None : TwoFactorAuthentication.TotpRequired); + return Ok(tokenResult); } ///