mirror of
https://github.com/openvk/openvk
synced 2024-12-22 16:42:32 +03:00
Use UA description instead of "api" in default API platform
OpenVK will try to guess OS and name of library which was used to make token generation request to more accurately represent.. stuff.
This commit is contained in:
parent
d9b595d250
commit
53fa14d89e
1 changed files with 2 additions and 1 deletions
|
@ -6,6 +6,7 @@ use openvk\VKAPI\Exceptions\APIErrorException;
|
|||
use openvk\Web\Models\Entities\{User, APIToken};
|
||||
use openvk\Web\Models\Repositories\{Users, APITokens};
|
||||
use lfkeitel\phptotp\{Base32, Totp};
|
||||
use WhichBrowser;
|
||||
|
||||
final class VKAPIPresenter extends OpenVKPresenter
|
||||
{
|
||||
|
@ -283,7 +284,7 @@ final class VKAPIPresenter extends OpenVKPresenter
|
|||
|
||||
$token = new APIToken;
|
||||
$token->setUser($user);
|
||||
$token->setPlatform(is_null($platform) ? "api" : $platform);
|
||||
$token->setPlatform($platform ?? (new WhichBrowser\Parser(getallheaders()))->toString());
|
||||
$token->save();
|
||||
|
||||
$payload = json_encode([
|
||||
|
|
Loading…
Reference in a new issue