refactor: compact two factor auth
This commit is contained in:
parent
516ba5bb8e
commit
0c6d1c9bfb
@ -253,11 +253,8 @@ public class AuthController(IOptionsSnapshot<Admin> user, IOptionsSnapshot<Gener
|
||||
/// <returns>A boolean indicating whether the two-factor authentication was successful.</returns>
|
||||
[HttpPost("2FA")]
|
||||
[BadRequestResponse]
|
||||
public async Task<ActionResult<bool>> TwoFactorAuth([FromBody] TwoFactorAuthRequest request)
|
||||
{
|
||||
var tokenResult = await auth.LoginAsync(GetCookieParams(), HttpContext, request.Method.ConvertFromDto(), request.Code);
|
||||
return Ok(tokenResult);
|
||||
}
|
||||
public async Task<ActionResult<bool>> TwoFactorAuth([FromBody] TwoFactorAuthRequest request) =>
|
||||
await auth.LoginAsync(GetCookieParams(), HttpContext, request.Method.ConvertFromDto(), request.Code);
|
||||
|
||||
/// <summary>
|
||||
/// Refreshes the authentication token using the existing refresh token.
|
||||
|
Loading…
x
Reference in New Issue
Block a user