Skip to content

Commit

Permalink
craft-oa-invitation-api Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
defstat committed Apr 11, 2024
1 parent fc2c3f7 commit 35ec86d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
21 changes: 21 additions & 0 deletions api/v1/invitations/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

/**
* @defgroup api_v1_invitations Invitations API requests
*/

/**
* @file api/v1/invitations/index.php
*
* Copyright (c) 2023 Simon Fraser University
* Copyright (c) 2023 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @ingroup api_v1_invitations
*
* @brief Handle API requests for invitations.
*/

use PKP\API\v1\invitations\PKPInvitationController;

return new \PKP\handler\APIHandler(new PKPInvitationController());
5 changes: 2 additions & 3 deletions pages/reviewer/ReviewerHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ public function authorize($request, &$args, $roleAssignments)
if ($context->getData('reviewerAccessKeysEnabled')) {
$accessKeyCode = $request->getUserVar('key');
if ($accessKeyCode) {
$keyHash = md5($accessKeyCode);

$invitation = Repo::invitation()->getBOByKeyHash($keyHash);
$invitation = Repo::invitation()
->getByMD5Key($accessKeyCode);

if (isset($invitation)) {
$invitation->acceptHandle();
Expand Down

0 comments on commit 35ec86d

Please sign in to comment.