Polish for Release (#2314)

This commit is contained in:
Joe Milazzo 2023-10-15 13:39:11 -05:00 committed by GitHub
parent fe4af4b648
commit 59b950c4bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 1162 additions and 1056 deletions

View file

@ -306,12 +306,13 @@ public class AccountController : BaseApiController
/// <summary>
/// Resets the API Key assigned with a user
/// </summary>
/// <remarks>This will log unauthorized requests to Security log</remarks>
/// <returns></returns>
[HttpPost("reset-api-key")]
public async Task<ActionResult<string>> ResetApiKey()
{
var user = await _unitOfWork.UserRepository.GetUserByUsernameAsync(User.GetUsername());
if (user == null) return Unauthorized();
if (user == null) throw new KavitaUnauthenticatedUserException();
user.ApiKey = HashUtil.ApiKey();