Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
a04f7bd6
Unverified
Commit
a04f7bd6
authored
Jan 22, 2022
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: force uploads to use auth headers instead of cookie
parent
92fe9d3e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
editor-modal-media.vue
client/components/editor/editor-modal-media.vue
+13
-1
security.js
server/helpers/security.js
+4
-0
No files found.
client/components/editor/editor-modal-media.vue
View file @
a04f7bd6
...
...
@@ -143,7 +143,7 @@
allow
-
multiple
=
'true'
:
files
=
'files'
max
-
files
=
'10'
server
=
'/u
'
:
server
=
'filePondServerOpts
'
:
instant
-
upload
=
'false'
:
allow
-
revert
=
'false'
@
processfile
=
'onFileProcessed'
...
...
@@ -230,6 +230,7 @@
<
script
>
import
_
from
'lodash'
import
{
get
,
sync
}
from
'vuex-pathify'
import
Cookies
from
'js-cookie'
import
vueFilePond
from
'vue-filepond'
import
'filepond/dist/filepond.min.css'
...
...
@@ -312,6 +313,17 @@ export default {
}
,
currentAsset
()
{
return
_
.
find
(
this
.
assets
,
[
'id'
,
this
.
currentFileId
])
||
{
}
}
,
filePondServerOpts
()
{
const
jwtToken
=
Cookies
.
get
(
'jwt'
)
return
{
process
:
{
url
:
'/u'
,
headers
:
{
'Authorization'
:
`Bearer ${jwtToken
}
`
}
}
}
}
}
,
watch
:
{
...
...
server/helpers/security.js
View file @
a04f7bd6
...
...
@@ -31,6 +31,10 @@ module.exports = {
if
(
req
&&
req
.
cookies
)
{
token
=
req
.
cookies
[
'jwt'
]
}
// Force uploads to use Auth headers
if
(
req
.
path
===
'/u'
)
{
return
null
}
return
token
}
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment