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
288 changed files with 15232 additions and 99 deletions
Showing only changes of commit c3c9844e2f - Show all commits

View File

@ -226,25 +226,17 @@ public class AuthService(ICacheService cache, IAccessToken accessTokenService, I
cookieOptions.DropCookie(context, CookieNames.AccessToken);
cookieOptions.DropCookie(context, CookieNames.RefreshToken);
const string error = "Token validation failed for user ID {UserId}. Fingerprint: {Fingerprint}. ";
if (authToken.RefreshToken != requestContext.RefreshToken)
logger.LogWarning(
error +
"Cached refresh token {ExpectedRefreshToken} does not match the provided refresh token {RefreshToken}",
logger.LogWarning("Token validation failed for user ID {UserId}. Fingerprint: {Fingerprint}. " +
"RefreshToken: {ExpectedRefreshToken} -> {RefreshToken}, " +
"UserAgent: {ExpectedUserAgent} -> {ProvidedUserAgent}, " +
"Ip: {ExpectedUserIp} -> {ProvidedIp}",
authToken.UserId,
authToken.Fingerprint,
authToken.RefreshToken,
requestContext.RefreshToken);
else
logger.LogWarning(
error +
"User-Agent {ExpectedUserAgent} and IP {ExpectedUserIp} in cache do not match the provided " +
"User-Agent {ProvidedUserAgent} and IP {ProvidedIp}",
authToken.UserId,
authToken.Fingerprint,
requestContext.RefreshToken,
authToken.UserAgent,
authToken.Ip,
requestContext.UserAgent,
authToken.Ip,
requestContext.Ip);
throw new SecurityException(defaultMessageError);