]> git.mxchange.org Git - friendica.git/commitdiff
Reformatted code
authorMichael <heluecht@pirati.ca>
Sun, 23 Jul 2023 20:20:46 +0000 (20:20 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 23 Jul 2023 20:20:46 +0000 (20:20 +0000)
src/Module/OAuth/Token.php
src/Security/OAuth.php

index 419fbd8781dcf1b2719c6e2fd41d99486f5a029b..f5aec0802ed8f5df7760e9f08e4e1c4093d87f3f 100644 (file)
@@ -91,8 +91,10 @@ class Token extends BaseApi
                } elseif ($request['grant_type'] == 'authorization_code') {
                        // For security reasons only allow freshly created tokens
                        $uri = new Uri($request['redirect_uri']);
-                       $condition = ["`redirect_uri` LIKE ? AND `id` = ? AND `code` = ? AND `created_at` > ?",
-                               '%' . $uri->getScheme() . '://' . $uri->getHost() . $uri->getPath() . '%', $application['id'], $request['code'], DateTimeFormat::utc('now - 5 minutes')];
+                       $condition = [
+                               "`redirect_uri` LIKE ? AND `id` = ? AND `code` = ? AND `created_at` > ?",
+                               '%' . $uri->getScheme() . '://' . $uri->getHost() . $uri->getPath() . '%', $application['id'], $request['code'], DateTimeFormat::utc('now - 5 minutes')
+                       ];
 
                        $token = DBA::selectFirst('application-view', ['access_token', 'created_at', 'uid'], $condition);
                        if (!DBA::isResult($token)) {
index f11927a53aa4423da6b51641618367f201d9382c..7655398b35118a96fcfbddd3d8e4ec359c25dea4 100644 (file)
@@ -146,7 +146,7 @@ class OAuth
                if (($application['redirect_uri'] != $redirect_uri) && !in_array($redirect_uri, explode(' ', $application['redirect_uri']))) {
                        return [];
                }
-               
+
                return $application;
        }
 
@@ -197,7 +197,8 @@ class OAuth
                        'write'          => (stripos($scope, BaseApi::SCOPE_WRITE) !== false),
                        'follow'         => (stripos($scope, BaseApi::SCOPE_FOLLOW) !== false),
                        'push'           => (stripos($scope, BaseApi::SCOPE_PUSH) !== false),
-                       'created_at'     => DateTimeFormat::utcNow()];
+                       'created_at'     => DateTimeFormat::utcNow()
+               ];
 
                foreach ([BaseApi::SCOPE_READ, BaseApi::SCOPE_WRITE, BaseApi::SCOPE_WRITE, BaseApi::SCOPE_PUSH] as $scope) {
                        if ($fields[$scope] && !$application[$scope]) {