Fix coding standards
This commit is contained in:
parent
126e281165
commit
ca5e0eaaea
1 changed files with 14 additions and 7 deletions
|
@ -121,7 +121,9 @@ class OAuth
|
|||
}
|
||||
|
||||
$bearer = trim(substr($authorization, 7));
|
||||
|
||||
$condition = ['access_token' => $bearer];
|
||||
|
||||
$token = DBA::selectFirst('application-view', ['uid', 'id', 'name', 'website', 'created_at', 'read', 'write', 'follow', 'push'], $condition);
|
||||
if (!DBA::isResult($token)) {
|
||||
Logger::warning('Token not found', $condition);
|
||||
|
@ -194,7 +196,12 @@ class OAuth
|
|||
$code = bin2hex(random_bytes(32));
|
||||
$access_token = bin2hex(random_bytes(32));
|
||||
|
||||
$fields = ['application-id' => $application['id'], 'uid' => $uid, 'code' => $code, 'access_token' => $access_token, 'scopes' => $scope,
|
||||
$fields = [
|
||||
'application-id' => $application['id'],
|
||||
'uid' => $uid,
|
||||
'code' => $code,
|
||||
'access_token' => $access_token,
|
||||
'scopes' => $scope,
|
||||
'read' => (stripos($scope, self::SCOPE_READ) !== false),
|
||||
'write' => (stripos($scope, self::SCOPE_WRITE) !== false),
|
||||
'follow' => (stripos($scope, self::SCOPE_FOLLOW) !== false),
|
||||
|
|
Loading…
Reference in a new issue