Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

Commit

Permalink
fix: bug upload image from clipboard (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
nhvu1988 committed May 5, 2022
1 parent 4c92934 commit fd67756
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions admin/src/components/editorjs/requiredTools.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import PluginId from '../../pluginId'
const axios = require('axios')
import { auth } from '@strapi/helper-plugin';

// Plugins for Editor.js
import Image from '@editorjs/image'
Expand All @@ -13,7 +14,7 @@ const requiredTools = {
data: JSON.stringify({})
},
additionalRequestHeaders: {
"Authorization": `Bearer ${JSON.parse(sessionStorage.getItem("jwtToken"))}`
"Authorization": `Bearer ${auth.getToken()}`
},
endpoints: {
byUrl: `/api/${PluginId}/image/byUrl`,
Expand All @@ -26,7 +27,7 @@ const requiredTools = {

const {data} = await axios.post(`/api/${PluginId}/image/byFile`, formData, {
headers: {
"Authorization": `Bearer ${JSON.parse(sessionStorage.getItem("jwtToken"))}`
"Authorization": `Bearer ${auth.getToken()}`
}
});

Expand Down
2 changes: 1 addition & 1 deletion admin/src/pluginId.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const pluginPkg = require('../../package.json');
const pluginId = pluginPkg.name.replace(
/^strapi-plugin-/i,
/^strapi-plugin-react-/i,
''
);

Expand Down

0 comments on commit fd67756

Please sign in to comment.