Skip to content

Commit

Permalink
hot fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LeDuyNhan1201 committed Nov 10, 2024
1 parent a16d409 commit b4cba09
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class CreatePhotoMetadataEventHandler

public Task Handle(DomainEvent.PhotoMetadataEvent request, CancellationToken cancellationToken)
{
logger.LogInformation("Handling message with file name: {Name}", request.Name);
logger.LogInformation("Handling message with file name: {Id}", request.Id);
return Task.CompletedTask;
}

Expand Down
7 changes: 4 additions & 3 deletions Identity.Presentation/Services/AuthService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using InfinityNetServer.BuildingBlocks.Presentation.Configuration.Jwt;
using InfinityNetServer.BuildingBlocks.Application.Services;
using InfinityNetServer.Services.Identity.Application.Services;
using InfinityNetServer.BuildingBlocks.Application.Exceptions;

namespace InfinityNetServer.Services.Identity.Presentation.Services
{
Expand Down Expand Up @@ -183,7 +184,7 @@ private async Task<JwtSecurityToken> VerifyToken(string token, bool isRefresh)

ValidateRefreshTokenSignature(token);
}
else if (expiryTime < DateTime.UtcNow) throw new IdentityException(IdentityErrorCode.TOKEN_INVALID, StatusCodes.Status401Unauthorized);
else if (expiryTime < DateTime.UtcNow) throw new CommonException(BaseErrorCode.TOKEN_INVALID, StatusCodes.Status401Unauthorized);

var jwtId = jwtToken.Id;
var value = await _baseRedisService.GetAsync(jwtId);
Expand Down Expand Up @@ -211,7 +212,7 @@ private async Task<JwtSecurityToken> VerifyToken(string token, bool isRefresh)
catch (Exception e)
{
_logger.LogError(e.Message);
throw new IdentityException(IdentityErrorCode.INVALID_SIGNATURE, StatusCodes.Status401Unauthorized);
throw new CommonException(BaseErrorCode.INVALID_SIGNATURE, StatusCodes.Status401Unauthorized);
}

}
Expand All @@ -238,7 +239,7 @@ private void ValidateRefreshTokenSignature(string token)
}
catch (Exception)
{
throw new IdentityException(IdentityErrorCode.INVALID_SIGNATURE, StatusCodes.Status401Unauthorized);
throw new CommonException(BaseErrorCode.INVALID_SIGNATURE, StatusCodes.Status401Unauthorized);
}
}

Expand Down
1 change: 0 additions & 1 deletion Profile.Application/Consumers/ProfileCreatedConsumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using Microsoft.Extensions.Logging;
using System.Threading.Tasks;
using System.Threading;
using InfinityNetServer.BuildingBlocks.Application.DTOs.Commands;
using InfinityNetServer.Services.Profile.Domain.Entities;
using System;
using InfinityNetServer.Services.Profile.Domain.Repositories;
Expand Down

0 comments on commit b4cba09

Please sign in to comment.