feat: добавил отображение аватарки
gitea-push-docker.yml (push) Invalid workflow file
Backend CI / build-and-test (push) Successful in 3m34s
Frontend CI / build-and-check (push) Failing after 21s

This commit is contained in:
serega404 committed 2026-10-01 00:17:16 +03:00
1 parent 34e450815b
commit 038f0d89a6
22 files changed
+598 -28

No files matched your search

@@ -108,6 +108,18 @@ public class AuthService : IAuthService
await _db.SaveChangesAsync();
}
try
{
if (string.IsNullOrWhiteSpace(user.AvatarUrl))
await _microsoftAuth.SaveTokenCacheAsync(user.Id, result);
else
await _microsoftAuth.RemoveTokenCacheAsync(user.Id);
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or System.Security.Cryptography.CryptographicException)
{
_logger.LogWarning(ex, "Could not save Microsoft token cache for user {UserId}.", user.Id);
}
var accessToken = GenerateAccessToken(user);
var refreshToken = await GenerateRefreshTokenAsync(user.Id);
await TrySendLoginNotificationAsync(user, ipAddress);
@@ -215,6 +227,18 @@ public class AuthService : IAuthService
}
}
public async Task RemoveMicrosoftTokenCacheAsync(int userId)
{
try
{
await _microsoftAuth.RemoveTokenCacheAsync(userId);
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
{
_logger.LogWarning(ex, "Could not remove Microsoft token cache for user {UserId}.", userId);
}
}
public async Task<CurrentUserDto> GetCurrentUserAsync(int userId)
{
var user = await _db.Users