From 6f02b88942e52a3401880c67c9957b66df691832 Mon Sep 17 00:00:00 2001 From: cryptooda Date: Tue, 14 May 2024 18:50:57 +0700 Subject: [PATCH] Update whitelisted address --- src/Managing.Application/Users/UserService.cs | 5 +++++ 1 file changed, 5 insertions(+) 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");