Skip to content

Commit

Permalink
contrib: fix orcid configuration
Browse files Browse the repository at this point in the history
* Adds error message when a remote server error occurs.

Signed-off-by: Johnny Mariéthoz <Johnny.Mariethoz@rero.ch>
  • Loading branch information
jma committed Jun 16, 2020
1 parent 42d2437 commit b2b696b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion invenio_oauthclient/contrib/orcid.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
'show_login': 'true'},
base_url='https://pub.orcid.org/v1.2/',
request_token_url=None,
access_token_url="https://api.orcid.org/oauth/token",
access_token_url="https://pub.orcid.org/oauth/token",
access_token_method='POST',
authorize_url='https://orcid.org/oauth/authorize',
app_key='ORCID_APP_CREDENTIALS',
Expand Down
6 changes: 6 additions & 0 deletions invenio_oauthclient/views/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ def authorized(remote_app=None):
abort(403)
except OAuthException as e:
if e.type == 'invalid_response':
current_app.logger.warning(
'{message} ({data})'.format(
message=e.message,
data=e.data
)
)
abort(500)
else:
raise
Expand Down

0 comments on commit b2b696b

Please sign in to comment.