Skip to content

Commit e1b7da1

Browse files
Merge pull request #158 from Sachintechjoomla/Bug#213483
Bug #213483 Fixed: JT App: All event API not working
2 parents ce2e52d + 8c573df commit e1b7da1

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

code/site/libraries/authentication.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,14 @@ public static function getCom_apiVersion()
189189
*/
190190
private static function getAuthMethod()
191191
{
192+
$app = Factory::getApplication();
193+
$key = $app->input->get('key');
192194

193195
if (isset($_SERVER['HTTP_X_AUTH']) && $_SERVER['HTTP_X_AUTH'])
194196
{
195197
$authMethod = $_SERVER['HTTP_X_AUTH'];
196198
}
197-
elseif (self::getBearerToken())
199+
elseif ($key || self::getBearerToken())
198200
{
199201
$authMethod = 'key';
200202
}

code/site/libraries/authentication/key.php

100755100644
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ class ApiAuthenticationKey extends ApiAuthentication
3333
public function authenticate()
3434
{
3535
$header_token = $this->getBearerToken();
36+
37+
if (!$header_token)
38+
{
39+
$app = Factory::getApplication();
40+
$header_token = $app->input->get('key');
41+
}
42+
3643
$token = $this->loadTokenByHash($header_token);
3744

3845
if (isset($token->state) && $token->state == 1)

0 commit comments

Comments
 (0)