mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-06-05 22:35:17 -04:00
No more JWTs for Scripts + Polish (#4274)
Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com>
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user