From ac7bbde75e07774428ce8d37d382629ffd937765 Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Wed, 29 May 2024 04:57:44 +0300 Subject: [PATCH] fix: add key for save pre auth token --- Security/Services/PreAuthService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Security/Services/PreAuthService.cs b/Security/Services/PreAuthService.cs index 21c97ff..484c5a1 100644 --- a/Security/Services/PreAuthService.cs +++ b/Security/Services/PreAuthService.cs @@ -16,7 +16,7 @@ public class PreAuthService(ICacheService cache) private static string GeneratePreAuthToken() => Guid.NewGuid().ToString().Replace("-", "") + GeneratorKey.GenerateString(16); - public async Task CreateLoginTokenAsync(TokenRequest request, string userId, CancellationToken cancellation = default) + private static string GetPreAuthCacheKey(string fingerprint) => $"{fingerprint}_pre_auth_token"; { var firstAuthToken = GenerateFirstAuthToken(); @@ -29,7 +29,7 @@ public class PreAuthService(ICacheService cache) }; await cache.SetAsync( - request.Fingerprint, + GetPreAuthCacheKey(request.Fingerprint), JsonSerializer.SerializeToUtf8Bytes(loginStructure), Lifetime, cancellation);