♻️ Move validation to Request
This commit is contained in:
@@ -21,14 +21,6 @@ class Bot
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
public function isRequestValid(): bool
|
||||
{
|
||||
return hash_equals(
|
||||
hash_hmac('sha256', $this->request->nc_random . $this->request->body, $this->config['secret']),
|
||||
strtolower($this->request->nc_signature)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $pattern the pattern to listen for
|
||||
* @param \Closure|string $callback the callback to execute. Either a closure or a Class@method notation
|
||||
|
||||
Reference in New Issue
Block a user