diff --git a/api/app/Http/Controllers/DPX.php b/api/app/Http/Controllers/DPX.php index fb1228a..869bde0 100755 --- a/api/app/Http/Controllers/DPX.php +++ b/api/app/Http/Controllers/DPX.php @@ -181,20 +181,20 @@ public static function Verify(string $wallet, string $secret) { public static function RevokeSecret(string $wallet, string $secret) { - if (Wallet::where([ 'wallet' => $wallet, 'secret' => $secret ])->count() > 0) { + $wallet = Wallet::where('wallet', $wallet)->first(); + + if ($wallet && Hash::check($secret, $wallet->secret)) { $new_secret = DPX::GenerateRandomHash(); - Wallet::where([ 'wallet' => $wallet, 'secret' => $secret ])->update([ 'secret' => $new_secret ]); + Wallet::where([ 'wallet' => $wallet ])->update([ 'secret' => Hash::make($new_secret) ]); return $new_secret; - }else{ - - return false; - } + return false; + } public static function GetBalance(string $wallet) {