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
286 changed files with 15112 additions and 99 deletions
Showing only changes of commit 5b7412f20f - Show all commits

View File

@ -326,7 +326,7 @@ public class OAuthService(ILogger<OAuthService> logger, Dictionary<OAuthProvider
return result; return result;
} }
public async Task<(OAuthUser? User, string? Message, bool IsSuccess)> public async Task<(OAuthUser? User, string? Message, bool IsSuccess, OAuthProvider? Provider)>
GetOAuthUser(CookieOptions cookieOptions, HttpContext context, string token, CancellationToken cancellation = default) GetOAuthUser(CookieOptions cookieOptions, HttpContext context, string token, CancellationToken cancellation = default)
{ {
var requestInfo = new RequestContextInfo(context, cookieOptions); var requestInfo = new RequestContextInfo(context, cookieOptions);
@ -350,7 +350,7 @@ public class OAuthService(ILogger<OAuthService> logger, Dictionary<OAuthProvider
requestInfo.Fingerprint, requestInfo.Fingerprint,
failedTokenAttemptsCount); failedTokenAttemptsCount);
return (null, "Too many unsuccessful token attempts. Please try again later.", false); return (null, "Too many unsuccessful token attempts. Please try again later.", false, null);
} }
logger.LogInformation( logger.LogInformation(
@ -364,7 +364,7 @@ public class OAuthService(ILogger<OAuthService> logger, Dictionary<OAuthProvider
slidingExpiration: failedTokenCacheExpiration, slidingExpiration: failedTokenCacheExpiration,
cancellationToken: cancellation); cancellationToken: cancellation);
return (null, "Invalid or expired token.", false); return (null, "Invalid or expired token.", false, null);
} }
await cache.RemoveAsync(tokenFailedKey, cancellation); await cache.RemoveAsync(tokenFailedKey, cancellation);
@ -385,6 +385,6 @@ public class OAuthService(ILogger<OAuthService> logger, Dictionary<OAuthProvider
else else
logger.LogInformation(log, token, requestInfo.Fingerprint); logger.LogInformation(log, token, requestInfo.Fingerprint);
return (result.User, result.Message, result.IsSuccess); return (result.User, result.Message, result.IsSuccess, result.Provider);
} }
} }