Skip to content

Commit

Permalink
Merge pull request #10854 from adlius/fix-citation-addons
Browse files Browse the repository at this point in the history
[ENG-6731] Fix zotero connection
  • Loading branch information
adlius authored Dec 17, 2024
2 parents ebbb59c + abccfc5 commit b2f1a2b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions addons/base/tests/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ def test_oauth_finish_enable_gv(self, mock_requests_get):
query_params = {
'code': 'somecode',
'state': 'somestatetoken',
'oauth_token': 'someoauthtoken',
'oauth_verifier': 'someverifier',
}
with override_flag(ENABLE_GV, active=True):
request_url = urlunparse(urlparse(url)._replace(query=urlencode(query_params)))
Expand Down
2 changes: 1 addition & 1 deletion osf/external/gravy_valet/translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class _LegacyConfigsForWBKey(enum.Enum):
onedrive = OneDriveAddonAppConfig
owncloud = OwnCloudAddonAppConfig
s3 = S3AddonAppConfig
zotero = ZoteroAddonAppConfig
zotero_org = ZoteroAddonAppConfig
mendeley = MendeleyAddonConfig


Expand Down
7 changes: 6 additions & 1 deletion website/oauth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,14 @@ def oauth_callback(service_name, auth):
def _forward_to_addon_service(oauth_version):
code = request.args.get('code')
state = request.args.get('state')
oauth_token = request.args.get('oauth_token')
oauth_verifier = request.args.get('oauth_verifier')
query_params = {
'code': code,
'state': state,
'oauth_token': oauth_token,
'oauth_verifier': oauth_verifier,
}

gv_url = urlunparse(urlparse(GRAVYVALET_URL)._replace(path=f'/v1/{oauth_version}/callback', query=urlencode(query_params)))
requests.get(gv_url)
requests.get(gv_url, cookies=request.cookies)

0 comments on commit b2f1a2b

Please sign in to comment.