mirror of
https://github.com/friendica/friendica
synced 2025-04-19 05:50:10 +00:00
use "random_bytes" instead of "openssl_random_pseudo_bytes"
This commit is contained in:
parent
cfb9b73205
commit
74f3c885bf
5 changed files with 8 additions and 8 deletions
|
@ -216,8 +216,8 @@ class BaseApi extends BaseModule
|
|||
|
||||
public static function getTokenForUser(array $application, int $uid)
|
||||
{
|
||||
$code = bin2hex(openssl_random_pseudo_bytes(32));
|
||||
$access_token = bin2hex(openssl_random_pseudo_bytes(32));
|
||||
$code = bin2hex(random_bytes(32));
|
||||
$access_token = bin2hex(random_bytes(32));
|
||||
|
||||
$fields = ['application-id' => $application['id'], 'uid' => $uid, 'code' => $code, 'access_token' => $access_token, 'created_at' => DateTimeFormat::utcNow(DateTimeFormat::MYSQL)];
|
||||
if (!DBA::insert('application-token', $fields, Database::INSERT_UPDATE)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue