fix(Gateway auth): cast numberic value to string value when compare gateway token (github #77)

github #77
This commit is contained in:
cubic
2022-03-31 18:32:05 +08:00
parent 1dd04a4d18
commit 980c8563d3

View File

@@ -15,7 +15,7 @@ class APIAuth
static function auth(array $authTypes)
{
if (in_array(self::AUTH_TYPE_GATEWAY, $authTypes)) {
if ((string) Request::parse()->token === YAML_GATEWAY_TOKEN) {
if ((string) Request::parse()->token === (string) YAML_GATEWAY_TOKEN) {
Request::setAuthData([]);
return TRUE;
}