Skip to content

Commit

Permalink
Fix bug with invalid redirect_url for Digikey
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeoLacruz committed Apr 30, 2024
1 parent 9f88b56 commit 9920ae6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions inventree_supplier_panel/supplier_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,17 +510,16 @@ def refresh_digikey_access_token(self):
return (token)

# --------------------------- receive_authcode --------------------------------
# The redirect_uri is just a string that has to be there. The content is
# ignored by Digikey

def receive_authcode(self, request):
auth_code = request.GET.get('code')
url = 'https://api.digikey.com/v1/oauth2/token'
redirect_uri = InvenTreeSetting.get_setting('INVENTREE_BASE_URL') + '/' + self.base_url + 'digikeytoken/'
url_data = {
'code': auth_code,
'client_id': self.get_setting('DIGIKEY_CLIENT_ID'),
'client_secret': self.get_setting('DIGIKEY_CLIENT_SECRET'),
'redirect_uri': 'https://192.168.1.40:8123/plugin/suppliercart/digikeytoken/',
'redirect_uri': redirect_uri,
'grant_type': 'authorization_code'
}
header = {}
Expand Down
2 changes: 1 addition & 1 deletion inventree_supplier_panel/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
PLUGIN_VERSION = "0.3.0"
PLUGIN_VERSION = "0.3.1"

0 comments on commit 9920ae6

Please sign in to comment.