diff --git a/admin/src/components/Input/index.js b/admin/src/components/Input/index.js index c39aab3..1e98532 100644 --- a/admin/src/components/Input/index.js +++ b/admin/src/components/Input/index.js @@ -75,7 +75,12 @@ const Tags = ({ return []; } try { - const res = await axios.get(attribute.options["apiUrl"]); + const token = attribute.options["apiToken"]; + const res = await axios.get(attribute.options["apiUrl"], { + headers: { + Authorization: `Bearer ${token}`, + }, + }); setSuggestions(res.data); } catch (err) { console.log(err); diff --git a/admin/src/index.js b/admin/src/index.js index cbef860..ed4deb5 100644 --- a/admin/src/index.js +++ b/admin/src/index.js @@ -38,6 +38,16 @@ export default { value: "", options: [], }, + { + intlLabel: { + id: "tagsinput.tags.section.apiUrl", + defaultMessage: "API Token", + }, + name: "options.apiToken", + type: "text", + value: "", + options: [], + }, ], }, ],