diff --git a/src/Managing.Application/Users/UserService.cs b/src/Managing.Application/Users/UserService.cs index c11d719..84f2e4d 100644 --- a/src/Managing.Application/Users/UserService.cs +++ b/src/Managing.Application/Users/UserService.cs @@ -11,6 +11,8 @@ public class UserService : IUserService private readonly IUserRepository _userRepository; private readonly IAccountService _accountService; + private string[] authorizedAddresses = new string[] { "0x6781920674dA695aa5120d95D80c4B1788046806" }; + public UserService( IEvmManager evmManager, IUserRepository userRepository, @@ -25,6 +27,9 @@ public class UserService : IUserService { var recoveredAddress = _evmManager.VerifySignature(signature, message); + if (!authorizedAddresses.Contains(recoveredAddress)) + throw new Exception("Address not authorized"); + if (recoveredAddress == null || !recoveredAddress.Equals(address)) throw new Exception("Address not corresponding");