From 9920ae6a88c352557b55fa598a1c62d92efb145a Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 30 Apr 2024 16:22:33 +0200 Subject: [PATCH] Fix bug with invalid redirect_url for Digikey --- inventree_supplier_panel/supplier_panel.py | 5 ++--- inventree_supplier_panel/version.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/inventree_supplier_panel/supplier_panel.py b/inventree_supplier_panel/supplier_panel.py index f388d2d..42c642e 100644 --- a/inventree_supplier_panel/supplier_panel.py +++ b/inventree_supplier_panel/supplier_panel.py @@ -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 = {} diff --git a/inventree_supplier_panel/version.py b/inventree_supplier_panel/version.py index 2f5d1c6..910fc92 100644 --- a/inventree_supplier_panel/version.py +++ b/inventree_supplier_panel/version.py @@ -1 +1 @@ -PLUGIN_VERSION = "0.3.0" +PLUGIN_VERSION = "0.3.1"