Add Application configuration #11
@ -6,7 +6,11 @@ namespace Mirea.Api.Security.Common.Interfaces;
|
|||||||
|
|
||||||
public interface ICacheService
|
public interface ICacheService
|
||||||
{
|
{
|
||||||
Task SetAsync<T>(string key, T value, TimeSpan? absoluteExpirationRelativeToNow = null, CancellationToken cancellationToken = default);
|
Task SetAsync<T>(string key, T value,
|
||||||
|
TimeSpan? absoluteExpirationRelativeToNow = null,
|
||||||
|
TimeSpan? slidingExpiration = null,
|
||||||
|
CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
Task<T?> GetAsync<T>(string key, CancellationToken cancellationToken = default);
|
Task<T?> GetAsync<T>(string key, CancellationToken cancellationToken = default);
|
||||||
Task RemoveAsync(string key, CancellationToken cancellationToken = default);
|
Task RemoveAsync(string key, CancellationToken cancellationToken = default);
|
||||||
}
|
}
|
||||||
|
@ -35,8 +35,8 @@ public class PreAuthService(ICacheService cache)
|
|||||||
await cache.SetAsync(
|
await cache.SetAsync(
|
||||||
GetPreAuthCacheKey(request.Fingerprint),
|
GetPreAuthCacheKey(request.Fingerprint),
|
||||||
JsonSerializer.SerializeToUtf8Bytes(preAuthTokenStruct),
|
JsonSerializer.SerializeToUtf8Bytes(preAuthTokenStruct),
|
||||||
Lifetime,
|
absoluteExpirationRelativeToNow: Lifetime,
|
||||||
cancellation);
|
cancellationToken: cancellation);
|
||||||
|
|
||||||
return new PreAuthTokenResponse
|
return new PreAuthTokenResponse
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user