Refactor user command handlers and update JWT token logic

This commit is contained in:
masoodafar-web
2025-11-14 04:37:35 +03:30
parent c48a04d5f9
commit 2944e3b648
8 changed files with 75 additions and 12 deletions

View File

@@ -1,4 +1,3 @@
using FrontOffice.BFF.Protobuf.Protos.User;
using FrontOffice.BFF.WebApi.Common.Services;
using FrontOffice.BFF.Application.UserCQ.Commands.UpdateUser;
using FrontOffice.BFF.Application.UserCQ.Commands.DeleteUser;
@@ -8,6 +7,8 @@ using FrontOffice.BFF.Application.UserCQ.Commands.CreateNewOtpToken;
using FrontOffice.BFF.Application.UserCQ.Commands.VerifyOtpToken;
using FrontOffice.BFF.Application.UserCQ.Queries.AdminGetJwtToken;
using FrontOffice.BFF.Application.UserCQ.Commands.SetPasswordForUser;
using FrontOffice.BFF.User.Protobuf.Protos.User;
namespace FrontOffice.BFF.WebApi.Services;
public class UserService : UserContract.UserContractBase
{
@@ -17,6 +18,7 @@ public class UserService : UserContract.UserContractBase
{
_dispatchRequestToCQRS = dispatchRequestToCQRS;
}
[Authorize(Roles = "user")]
public override async Task<Empty> UpdateUser(UpdateUserRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<UpdateUserRequest, UpdateUserCommand>(request, context);