Refactor UpdateUserCommandHandler to include current user service and adjust user ID handling
This commit is contained in:
@@ -4,19 +4,25 @@ using FrontOffice.BFF.Infrastructure.Services;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.IdentityModel.Logging;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
|
||||
namespace Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
public static class ConfigureServices
|
||||
{
|
||||
public static IServiceCollection AddInfrastructureServices(this IServiceCollection services, IConfiguration configuration)
|
||||
public static IServiceCollection AddInfrastructureServices(this IServiceCollection services,
|
||||
IConfiguration configuration)
|
||||
{
|
||||
services.AddSingleton<IApplicationContractContext, ApplicationContractContext>();
|
||||
services.AddSingleton<IKavenegarService, KavenegarService>();
|
||||
services.AddInfrastructureGrpcServices(configuration);
|
||||
|
||||
#region AddAuthentication
|
||||
|
||||
#if DEBUG
|
||||
IdentityModelEventSource.ShowPII = true;
|
||||
#endif
|
||||
var message = "";
|
||||
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
|
||||
.AddJwtBearer(jwtBearerOptions =>
|
||||
@@ -31,8 +37,8 @@ public static class ConfigureServices
|
||||
jwtBearerOptions.RequireHttpsMetadata = false;
|
||||
jwtBearerOptions.TokenValidationParameters = new TokenValidationParameters
|
||||
{
|
||||
ValidateIssuer = false,//todo change to true in production
|
||||
ValidateAudience = false,//todo change to true in production
|
||||
ValidateIssuer = false, //todo change to true in production
|
||||
ValidateAudience = false, //todo change to true in production
|
||||
ValidateLifetime = true,
|
||||
ValidateIssuerSigningKey = true,
|
||||
ValidIssuer = configuration["JwtIssuer"],
|
||||
|
||||
Reference in New Issue
Block a user