Add Application configuration #11

Merged
Wesser merged 128 commits from feat/add-setup into release/v1.0.0 2024-06-01 07:35:30 +03:00
Showing only changes of commit ac7bbde75e - Show all commits

View File

@ -16,7 +16,7 @@ public class PreAuthService(ICacheService cache)
private static string GeneratePreAuthToken() => Guid.NewGuid().ToString().Replace("-", "") + private static string GeneratePreAuthToken() => Guid.NewGuid().ToString().Replace("-", "") +
GeneratorKey.GenerateString(16); GeneratorKey.GenerateString(16);
public async Task<PreAuthTokenResponse> CreateLoginTokenAsync(TokenRequest request, string userId, CancellationToken cancellation = default) private static string GetPreAuthCacheKey(string fingerprint) => $"{fingerprint}_pre_auth_token";
{ {
var firstAuthToken = GenerateFirstAuthToken(); var firstAuthToken = GenerateFirstAuthToken();
@ -29,7 +29,7 @@ public class PreAuthService(ICacheService cache)
}; };
await cache.SetAsync( await cache.SetAsync(
request.Fingerprint, GetPreAuthCacheKey(request.Fingerprint),
JsonSerializer.SerializeToUtf8Bytes(loginStructure), JsonSerializer.SerializeToUtf8Bytes(loginStructure),
Lifetime, Lifetime,
cancellation); cancellation);