From e2de2e7a9f79de8687caab3a510e92d74d6173c7 Mon Sep 17 00:00:00 2001 From: Taslan Graham Date: Thu, 12 Sep 2024 16:06:54 -0500 Subject: [PATCH] pkp/pkp-lib#10389 Track author Orcid verification request state --- api/v1/orcid/OrcidController.php | 1 + classes/orcid/actions/VerifyAuthorWithOrcid.php | 4 +--- schemas/author.json | 4 ++++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/api/v1/orcid/OrcidController.php b/api/v1/orcid/OrcidController.php index adc0659b4a4..29c5f9d7dca 100644 --- a/api/v1/orcid/OrcidController.php +++ b/api/v1/orcid/OrcidController.php @@ -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([ diff --git a/classes/orcid/actions/VerifyAuthorWithOrcid.php b/classes/orcid/actions/VerifyAuthorWithOrcid.php index d769bc67b54..f705462fc04 100644 --- a/classes/orcid/actions/VerifyAuthorWithOrcid.php +++ b/classes/orcid/actions/VerifyAuthorWithOrcid.php @@ -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); } @@ -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 { @@ -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 { diff --git a/schemas/author.json b/schemas/author.json index 18fbfd56566..8c089d8fef6 100644 --- a/schemas/author.json +++ b/schemas/author.json @@ -193,6 +193,10 @@ "validation": [ "nullable" ] + }, + "orcidVerificationRequested": { + "type": "boolean", + "apiSummary": true } } }