Skip to content

Commit

Permalink
#10389 Track author Orcid verification request state
Browse files Browse the repository at this point in the history
  • Loading branch information
taslangraham committed Sep 20, 2024
1 parent 5f0413d commit 0b5bd69
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions api/v1/orcid/OrcidController.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public function requestAuthorVerification(Request $illuminateRequest): JsonRespo

$author = $validate['author']; /** @var Author $author */
try {
$author->setData('orcidVerificationRequested', true);
dispatch(new SendAuthorMail($author, $context, true));
} catch (\Exception $exception) {
return response()->json([
Expand Down
4 changes: 1 addition & 3 deletions classes/orcid/actions/VerifyAuthorWithOrcid.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public function execute(): self

$this->author->setOrcid($orcidUri);
$this->author->setOrcidVerified(true);
$this->author->setData('orcidVerificationRequested', null);
if (OrcidManager::isSandbox($context)) {
$this->author->setData('orcidEmailToken', null);
}
Expand Down Expand Up @@ -133,7 +134,6 @@ public function execute(): self
* Takes template variables for frontend display from OAuth process and assigns them to the TemplateManager.
*
* @param TemplateManager $templateMgr The template manager to which the variable should be set
* @return void
*/
public function updateTemplateMgrVars(TemplateManager &$templateMgr): void
{
Expand All @@ -146,8 +146,6 @@ public function updateTemplateMgrVars(TemplateManager &$templateMgr): void
* Helper to set ORCID and OAuth values to the author. NB: Does not save updated Author instance to the database.
*
* @param string $orcidUri Complete ORCID URL
* @param array $results
* @return void
*/
private function setOrcidAccessData(string $orcidUri, array $results): void
{
Expand Down
4 changes: 4 additions & 0 deletions schemas/author.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@
"validation": [
"nullable"
]
},
"orcidVerificationRequested": {
"type": "boolean",
"apiSummary": false
}
}
}

0 comments on commit 0b5bd69

Please sign in to comment.