No more JWTs for Scripts + Polish (#4274)

Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com>
This commit is contained in:
Joe Milazzo
2025-12-13 06:55:02 -07:00
committed by GitHub
parent b67680c639
commit 8043650aa5
131 changed files with 7804 additions and 1849 deletions
+11
View File
@@ -74,4 +74,15 @@ public class PluginController(IUnitOfWork unitOfWork, ITokenService tokenService
if (userId <= 0) throw new KavitaUnauthenticatedUserException();
return Ok((await unitOfWork.SettingsRepository.GetSettingAsync(ServerSettingKey.InstallVersion)).Value);
}
/// <summary>
/// Returns the expiration (UTC) of the authenticated Auth key (or null if none set)
/// </summary>
/// <remarks>Will always return null if the Auth Key does not belong to this account</remarks>
/// <returns></returns>
[HttpGet("authkey-expires")]
public async Task<ActionResult<DateTime?>> GetAuthKeyExpiration([Required] string authKey)
{
return Ok(await unitOfWork.UserRepository.GetAuthKeyExpiration(authKey, UserId));
}
}