refactor: transfer two factor method to security
This commit is contained in:
		| @@ -54,11 +54,11 @@ public class AuthController(IOptionsSnapshot<Admin> user, AuthService auth, Pass | ||||
|         return Ok(tokenResult.ConvertToDto()); | ||||
|     } | ||||
|  | ||||
|     [HttpGet("Login")] | ||||
|     [HttpPost("2FA")] | ||||
|     [BadRequestResponse] | ||||
|     public async Task<ActionResult<TwoFactorAuthentication>> Login([FromQuery] string code) | ||||
|     public async Task<ActionResult<TwoFactorAuthentication>> TwoFactorAuth([FromBody] TwoFactorAuthRequest request) | ||||
|     { | ||||
|         var tokenResult = await auth.LoginAsync(GetCookieParams(), HttpContext, code); | ||||
|         var tokenResult = await auth.LoginAsync(GetCookieParams(), HttpContext, request.Method.ConvertFromDto(), request.Code); | ||||
|         return Ok(tokenResult ? TwoFactorAuthentication.None : TwoFactorAuthentication.TotpRequired); | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user