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>
|
/// <returns>A boolean indicating whether the two-factor authentication was successful.</returns>
|
||||||
[HttpPost("2FA")]
|
[HttpPost("2FA")]
|
||||||
[BadRequestResponse]
|
[BadRequestResponse]
|
||||||
public async Task<ActionResult<bool>> TwoFactorAuth([FromBody] TwoFactorAuthRequest request)
|
public async Task<ActionResult<bool>> TwoFactorAuth([FromBody] TwoFactorAuthRequest request) =>
|
||||||
{
|
await auth.LoginAsync(GetCookieParams(), HttpContext, request.Method.ConvertFromDto(), request.Code);
|
||||||
var tokenResult = await auth.LoginAsync(GetCookieParams(), HttpContext, request.Method.ConvertFromDto(), request.Code);
|
|
||||||
return Ok(tokenResult);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Refreshes the authentication token using the existing refresh token.
|
/// Refreshes the authentication token using the existing refresh token.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user