mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
[CST-5669] Returns 422 in case of invalid authorization code during ORCID connection
This commit is contained in:
@@ -63,7 +63,7 @@ public class ResearcherProfileAddOrcidOperation extends PatchOperation<Researche
|
||||
} catch (OrcidClientException ex) {
|
||||
|
||||
if (ex.isInvalidGrantException()) {
|
||||
throw new IllegalArgumentException("The provided ORCID authorization code is not valid", ex);
|
||||
throw new UnprocessableEntityException("The provided ORCID authorization code is not valid", ex);
|
||||
}
|
||||
|
||||
throw ex;
|
||||
|
@@ -2288,7 +2288,7 @@ public class ResearcherProfileRestRepositoryIT extends AbstractControllerIntegra
|
||||
.perform(patch("/api/eperson/profiles/{id}", user.getID().toString())
|
||||
.content(getPatchContent(asList(new AddOperation("/orcid", code))))
|
||||
.contentType(MediaType.APPLICATION_JSON_VALUE))
|
||||
.andExpect(status().isBadRequest());
|
||||
.andExpect(status().isUnprocessableEntity());
|
||||
|
||||
verify(orcidClientMock).getAccessToken(code);
|
||||
verifyNoMoreInteractions(orcidClientMock);
|
||||
|
Reference in New Issue
Block a user