docs: add comment
This commit is contained in:
parent
95627003e5
commit
503f5792fb
@ -29,12 +29,21 @@ public class AuthController(IOptionsSnapshot<Admin> user, AuthService auth, Pass
|
||||
Path = UrlHelper.GetSubPathWithoutFirstApiName + "api"
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of available OAuth providers with their respective redirect URIs.
|
||||
/// </summary>
|
||||
/// <returns>A list of available providers.</returns>
|
||||
[HttpGet("GetAvailableProviders")]
|
||||
public ActionResult<List<AvailableProvidersResponse>> GetUrls() =>
|
||||
Ok(oAuthService
|
||||
.GetAvailableProviders(HttpContext, GetCookieParams(), HttpContext.GetApiUrl(Url.Action("OAuth2")!))
|
||||
.ConvertToDto());
|
||||
|
||||
/// <summary>
|
||||
/// Logs in a user using their username or email and password.
|
||||
/// </summary>
|
||||
/// <param name="request">The login request containing username/email and password.</param>
|
||||
/// <returns>A TwoFactorAuthentication token if the login is successful; otherwise, a BadRequest response.</returns>
|
||||
[HttpPost("Login")]
|
||||
[BadRequestResponse]
|
||||
public async Task<ActionResult<TwoFactorAuthentication>> Login([FromBody] LoginRequest request)
|
||||
@ -63,6 +72,11 @@ public class AuthController(IOptionsSnapshot<Admin> user, AuthService auth, Pass
|
||||
return Ok(tokenResult.ConvertToDto());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs two-factor authentication for the user.
|
||||
/// </summary>
|
||||
/// <param name="request">The request containing the method and code for two-factor authentication.</param>
|
||||
/// <returns>A boolean indicating whether the two-factor authentication was successful.</returns>
|
||||
[HttpPost("2FA")]
|
||||
[BadRequestResponse]
|
||||
public async Task<ActionResult<bool>> TwoFactorAuth([FromBody] TwoFactorAuthRequest request)
|
||||
|
Loading…
x
Reference in New Issue
Block a user