Verified Commit d073b44c authored by Rigel Kent's avatar Rigel Kent
Browse files

recaptcha init

parent 3b14ca53
...@@ -2,4 +2,8 @@ ...@@ -2,4 +2,8 @@
PeerTube plugin adding ReCaptcha v2 to the signup PeerTube plugin adding ReCaptcha v2 to the signup
## Read First
This plugin is NOT supported by Framasoft, nor any organisation.
![](http://lutim.cpy.re/uWR04Q7m.png) ![](http://lutim.cpy.re/uWR04Q7m.png)
...@@ -39,7 +39,7 @@ function initRC(registerHook, peertubeHelpers) { ...@@ -39,7 +39,7 @@ function initRC(registerHook, peertubeHelpers) {
) )
registerHook({ registerHook({
target: "filter:signup.register.body", target: "filter:api.signup.registration.create.params",
handler: body => handler: body =>
Object.assign({}, body, { Object.assign({}, body, {
"g-recaptcha-response": window.ReCaptchaLoadCallbackResponse "g-recaptcha-response": window.ReCaptchaLoadCallbackResponse
......
...@@ -56,7 +56,7 @@ async function verifyCaptcha (result, params, settingsManager) { ...@@ -56,7 +56,7 @@ async function verifyCaptcha (result, params, settingsManager) {
"&response=" + "&response=" +
params.body["g-recaptcha-response"] + params.body["g-recaptcha-response"] +
"&remoteip=" + "&remoteip=" +
params.connection.remoteAddress params.ip
return get(verificationUrl, function (err, res, body) { return get(verificationUrl, function (err, res, body) {
body = JSON.parse(body) body = JSON.parse(body)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"description": "PeerTube plugin adding ReCaptcha v2 to the signup", "description": "PeerTube plugin adding ReCaptcha v2 to the signup",
"version": "0.0.1", "version": "0.0.1",
"author": "Rigel Kent", "author": "Rigel Kent",
"bugs": "https://framagit.org/framasoft/peertube/peertube-plugin-quickstart/issues", "bugs": "https://framagit.org/framasoft/peertube/peertube-plugin-recaptcha/issues",
"clientScripts": [ "clientScripts": [
{ {
"script": "dist/signup-client-plugin.js", "script": "dist/signup-client-plugin.js",
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
"homepage": "https://framagit.org/framasoft/peertube/peertube-plugin-recaptcha", "homepage": "https://framagit.org/framasoft/peertube/peertube-plugin-recaptcha",
"keywords": [ "keywords": [
"peertube", "peertube",
"plugin" "plugin",
"captcha"
], ],
"library": "./main.js", "library": "./main.js",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment