Release v1.0.0 #16

Merged
Wesser merged 492 commits from release/v1.0.0 into master 2025-02-12 09:19:32 +03:00
179 changed files with 5393 additions and 58 deletions
Showing only changes of commit 4138c70007 - Show all commits

View File

@ -10,7 +10,7 @@ using System.Threading.Tasks;
namespace Mirea.Api.Security.Services;
public class AuthService(ICacheService cache, IAccessToken accessTokenService)
public class AuthService(ICacheService cache, IAccessToken accessTokenService, IRevokedToken revokedToken)
{
public TimeSpan Lifetime { private get; init; }
@ -28,6 +28,9 @@ public class AuthService(ICacheService cache, IAccessToken accessTokenService)
slidingExpiration: Lifetime,
cancellationToken: cancellation);
private Task RevokeAccessToken(string token) =>
revokedToken.AddTokenToRevokedAsync(token, accessTokenService.GetExpireDateTime(token));
public async Task<AuthTokenResponse> GenerateAuthTokensAsync(TokenRequest request, string preAuthToken, CancellationToken cancellation = default)
{
string userId = await new PreAuthService(cache).MatchToken(request, preAuthToken, cancellation);