Update whitelisted address
This commit is contained in:
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user