Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Ms Kimsible
peertube-plugin-mtcaptcha2
Commits
ea794321
Commit
ea794321
authored
Sep 16, 2021
by
Ms Kimsible
Browse files
Fix undefined body param when captcha not filled
parent
c306b794
Changes
1
Hide whitespace changes
Inline
Side-by-side
main.js
View file @
ea794321
...
@@ -37,7 +37,7 @@ module.exports = {
...
@@ -37,7 +37,7 @@ module.exports = {
async
function
verifyCaptcha
(
result
,
params
,
settingsManager
)
{
async
function
verifyCaptcha
(
result
,
params
,
settingsManager
)
{
// mtcaptcha-response is the key that browser will generate upon form submit.
// mtcaptcha-response is the key that browser will generate upon form submit.
// if its blank or null means user has not selected the captcha, so return the error.
// if its blank or null means user has not selected the captcha, so return the error.
if
(
!
params
.
body
[
"
mtcaptcha-response
"
])
{
if
(
!
params
.
body
||
!
params
.
body
[
"
mtcaptcha-response
"
])
{
return
{
allowed
:
false
,
errorMessage
:
"
Captcha wasn't filled
"
}
return
{
allowed
:
false
,
errorMessage
:
"
Captcha wasn't filled
"
}
}
}
...
...
Write
Preview
Supports
Markdown
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