mirror of
https://github.com/friendica/friendica
synced 2025-04-19 05:50:10 +00:00
Repurposed OAuth frontend handling, store the scope
This commit is contained in:
parent
132e08edb8
commit
b18073d5a8
9 changed files with 121 additions and 139 deletions
|
@ -267,9 +267,9 @@ class BaseApi extends BaseModule
|
|||
$code = bin2hex(random_bytes(32));
|
||||
$access_token = bin2hex(random_bytes(32));
|
||||
|
||||
// @todo store the scope
|
||||
|
||||
$fields = ['application-id' => $application['id'], 'uid' => $uid, 'code' => $code, 'access_token' => $access_token, 'created_at' => DateTimeFormat::utcNow(DateTimeFormat::MYSQL)];
|
||||
$fields = ['application-id' => $application['id'], 'uid' => $uid, 'code' => $code, 'access_token' => $access_token, 'scopes' => $scope,
|
||||
'read' => (stripos($scope, 'read') !== false), 'write' => (stripos($scope, 'write') !== false),
|
||||
'follow' => (stripos($scope, 'follow') !== false), 'created_at' => DateTimeFormat::utcNow(DateTimeFormat::MYSQL)];
|
||||
if (!DBA::insert('application-token', $fields, Database::INSERT_UPDATE)) {
|
||||
return [];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue