1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
cloudoauthrefreshdata.php
См. документацию.
1<?php
2
4
6
8{
9 public function __construct(
10 public readonly string $uid,
11 public readonly int $expires,
12 ) {}
13
14 protected function getSignPayload(): string
15 {
16 return implode('_', [
17 $this->uid,
18 $this->expires,
19 ]);
20 }
21
22 public function getSign(): string
23 {
24 return $this->getSigner()->getSignature($this->getSignPayload(), static::getSignSalt());
25 }
26
27 public function isSignValid(string $sign): bool
28 {
29 try
30 {
31 return $this->getSigner()->validate($this->getSignPayload(), $sign, static::getSignSalt());
32 }
33 catch (\Exception $exception)
34 {
35 return false;
36 }
37 }
38
39 protected function getSigner(): Signer
40 {
41 return new Signer();
42 }
43
44 protected static function getSignSalt(): string
45 {
46 return 'oauth_email_token_refresh';
47 }
48}
__construct(public readonly string $uid, public readonly int $expires,)
Определения cloudoauthrefreshdata.php:9
$uid
Определения hot_keys_act.php:8
$sign
Определения payment.php:69