mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Генерируемые AccessTokens заменены на UUID значения
This commit is contained in:
17
common/components/oauth/Util/KeyAlgorithm/UuidAlgorithm.php
Normal file
17
common/components/oauth/Util/KeyAlgorithm/UuidAlgorithm.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
namespace common\components\oauth\Util\KeyAlgorithm;
|
||||
|
||||
use League\OAuth2\Server\Util\KeyAlgorithm\DefaultAlgorithm;
|
||||
use League\OAuth2\Server\Util\KeyAlgorithm\KeyAlgorithmInterface;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
|
||||
class UuidAlgorithm extends DefaultAlgorithm implements KeyAlgorithmInterface {
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function generate($len = 40) : string {
|
||||
return Uuid::uuid5(Uuid::NAMESPACE_DNS, parent::generate($len))->toString();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user