diff --git a/Security/Services/AuthService.cs b/Security/Services/AuthService.cs index 90ceb14..c0be65c 100644 --- a/Security/Services/AuthService.cs +++ b/Security/Services/AuthService.cs @@ -6,12 +6,14 @@ using System; namespace Mirea.Api.Security.Services; -public class AuthService(ICacheService cache) +public class AuthService(ICacheService cache, IAccessToken accessTokenService) { public TimeSpan Lifetime { private get; init; } private static string GenerateRefreshToken() => Guid.NewGuid().ToString().Replace("-", "") + GeneratorKey.GenerateString(32); + private (string Token, DateTime ExpireIn) GenerateAccessToken(string userId) => + accessTokenService.GenerateToken(userId); private static string GetAuthCacheKey(string fingerprint) => $"{fingerprint}_auth_token";