add captcha to registration

This commit is contained in:
Jannis Portmann 2021-05-04 11:59:08 +02:00
parent 4fd13f7dde
commit 728727b747
5 changed files with 3951 additions and 3722 deletions

View file

@ -16,3 +16,6 @@ import '@fortawesome/fontawesome-free/js/fontawesome'
import '@fortawesome/fontawesome-free/js/solid' import '@fortawesome/fontawesome-free/js/solid'
import '@fortawesome/fontawesome-free/js/regular' import '@fortawesome/fontawesome-free/js/regular'
import '@fortawesome/fontawesome-free/js/brands' import '@fortawesome/fontawesome-free/js/brands'
// Friendly captcha
import "friendly-challenge/widget";

122
package-lock.json generated
View file

@ -5,6 +5,9 @@
"packages": { "packages": {
"": { "": {
"license": "UNLICENSED", "license": "UNLICENSED",
"dependencies": {
"friendly-challenge": "^0.8.5"
},
"devDependencies": { "devDependencies": {
"@fortawesome/fontawesome-free": "^5.15.3", "@fortawesome/fontawesome-free": "^5.15.3",
"@symfony/stimulus-bridge": "^2.0.0", "@symfony/stimulus-bridge": "^2.0.0",
@ -1377,6 +1380,15 @@
"regenerator-runtime": "^0.13.4" "regenerator-runtime": "^0.13.4"
} }
}, },
"node_modules/@babel/runtime-corejs3": {
"version": "7.14.0",
"resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.14.0.tgz",
"integrity": "sha512-0R0HTZWHLk6G8jIk0FtoX+AatCtKnswS98VhXwGImFc759PJRp4Tru0PQYZofyijTFUr+gT8Mu7sgXVJLQ0ceg==",
"dependencies": {
"core-js-pure": "^3.0.0",
"regenerator-runtime": "^0.13.4"
}
},
"node_modules/@babel/template": { "node_modules/@babel/template": {
"version": "7.12.13", "version": "7.12.13",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz",
@ -3017,7 +3029,6 @@
"version": "3.11.0", "version": "3.11.0",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.11.0.tgz", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.11.0.tgz",
"integrity": "sha512-bd79DPpx+1Ilh9+30aT5O1sgpQd4Ttg8oqkqi51ZzhedMM1omD2e6IOF48Z/DzDCZ2svp49tN/3vneTK6ZBkXw==", "integrity": "sha512-bd79DPpx+1Ilh9+30aT5O1sgpQd4Ttg8oqkqi51ZzhedMM1omD2e6IOF48Z/DzDCZ2svp49tN/3vneTK6ZBkXw==",
"dev": true,
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",
"funding": { "funding": {
@ -3050,6 +3061,16 @@
"semver": "bin/semver.js" "semver": "bin/semver.js"
} }
}, },
"node_modules/core-js-pure": {
"version": "3.11.2",
"resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.11.2.tgz",
"integrity": "sha512-DQxdEKm+zFsnON7ZGOgUAQXBt1UJJ01tOzN/HgQ7cNf0oEHW1tcBLfCQQd1q6otdLu5gAdvKYxKHAoXGwE/kiQ==",
"hasInstallScript": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/core-js"
}
},
"node_modules/core-util-is": { "node_modules/core-util-is": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
@ -4417,6 +4438,20 @@
"node": ">= 0.6" "node": ">= 0.6"
} }
}, },
"node_modules/friendly-challenge": {
"version": "0.8.5",
"resolved": "https://registry.npmjs.org/friendly-challenge/-/friendly-challenge-0.8.5.tgz",
"integrity": "sha512-z0Lc60oVLU3IYVpeUzd/adh+cEk1LK31KMvYL67bJCrPfyBbWRGmDo3r1dPbNcs5aReHbLxAtYHNXzEvkG+7ng==",
"dependencies": {
"@babel/runtime-corejs3": "^7.10.4",
"core-js": "^3.6.5",
"friendly-pow": "0.1.2",
"object-assign-polyfill": "^0.1.0",
"promis": "^1.1.4",
"url-polyfill": "^1.1.10",
"whatwg-fetch": "^3.4.1"
}
},
"node_modules/friendly-errors-webpack-plugin": { "node_modules/friendly-errors-webpack-plugin": {
"version": "2.0.0-beta.2", "version": "2.0.0-beta.2",
"resolved": "https://registry.npmjs.org/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-2.0.0-beta.2.tgz", "resolved": "https://registry.npmjs.org/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-2.0.0-beta.2.tgz",
@ -4459,6 +4494,11 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/friendly-pow": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/friendly-pow/-/friendly-pow-0.1.2.tgz",
"integrity": "sha512-Ihnr6Ii9zDAPU0ylpRpjiWSIBUApuLOC8JtO7WMhh5Z5Fu+QjQHqZpV5tHwx3/pV3MOW20zSrGvdL05BpxpSjw=="
},
"node_modules/fs-minipass": { "node_modules/fs-minipass": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz",
@ -6140,6 +6180,11 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/object-assign-polyfill": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/object-assign-polyfill/-/object-assign-polyfill-0.1.0.tgz",
"integrity": "sha1-K3Izj/aLdwzc2ngYYEhLuLL0CSA="
},
"node_modules/object-inspect": { "node_modules/object-inspect": {
"version": "1.10.2", "version": "1.10.2",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.2.tgz", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.2.tgz",
@ -7171,6 +7216,11 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/promis": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/promis/-/promis-1.1.4.tgz",
"integrity": "sha1-DQ70PMrKzdj5Z5zW4JUPfH9SCWw="
},
"node_modules/promise-inflight": { "node_modules/promise-inflight": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz",
@ -7372,7 +7422,6 @@
"version": "0.13.7", "version": "0.13.7",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz",
"integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==",
"dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/regenerator-transform": { "node_modules/regenerator-transform": {
@ -8792,6 +8841,11 @@
"querystring": "0.2.0" "querystring": "0.2.0"
} }
}, },
"node_modules/url-polyfill": {
"version": "1.1.12",
"resolved": "https://registry.npmjs.org/url-polyfill/-/url-polyfill-1.1.12.tgz",
"integrity": "sha512-mYFmBHCapZjtcNHW0MDq9967t+z4Dmg5CJ0KqysK3+ZbyoNOWQHksGCTWwDhxGXllkWlOc10Xfko6v4a3ucM6A=="
},
"node_modules/util-deprecate": { "node_modules/util-deprecate": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
@ -9191,6 +9245,11 @@
"node": ">=0.8.0" "node": ">=0.8.0"
} }
}, },
"node_modules/whatwg-fetch": {
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz",
"integrity": "sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA=="
},
"node_modules/which": { "node_modules/which": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
@ -10323,6 +10382,15 @@
"regenerator-runtime": "^0.13.4" "regenerator-runtime": "^0.13.4"
} }
}, },
"@babel/runtime-corejs3": {
"version": "7.14.0",
"resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.14.0.tgz",
"integrity": "sha512-0R0HTZWHLk6G8jIk0FtoX+AatCtKnswS98VhXwGImFc759PJRp4Tru0PQYZofyijTFUr+gT8Mu7sgXVJLQ0ceg==",
"requires": {
"core-js-pure": "^3.0.0",
"regenerator-runtime": "^0.13.4"
}
},
"@babel/template": { "@babel/template": {
"version": "7.12.13", "version": "7.12.13",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz",
@ -11562,8 +11630,7 @@
"core-js": { "core-js": {
"version": "3.11.0", "version": "3.11.0",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.11.0.tgz", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.11.0.tgz",
"integrity": "sha512-bd79DPpx+1Ilh9+30aT5O1sgpQd4Ttg8oqkqi51ZzhedMM1omD2e6IOF48Z/DzDCZ2svp49tN/3vneTK6ZBkXw==", "integrity": "sha512-bd79DPpx+1Ilh9+30aT5O1sgpQd4Ttg8oqkqi51ZzhedMM1omD2e6IOF48Z/DzDCZ2svp49tN/3vneTK6ZBkXw=="
"dev": true
}, },
"core-js-compat": { "core-js-compat": {
"version": "3.11.0", "version": "3.11.0",
@ -11583,6 +11650,11 @@
} }
} }
}, },
"core-js-pure": {
"version": "3.11.2",
"resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.11.2.tgz",
"integrity": "sha512-DQxdEKm+zFsnON7ZGOgUAQXBt1UJJ01tOzN/HgQ7cNf0oEHW1tcBLfCQQd1q6otdLu5gAdvKYxKHAoXGwE/kiQ=="
},
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
@ -12569,6 +12641,20 @@
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=",
"dev": true "dev": true
}, },
"friendly-challenge": {
"version": "0.8.5",
"resolved": "https://registry.npmjs.org/friendly-challenge/-/friendly-challenge-0.8.5.tgz",
"integrity": "sha512-z0Lc60oVLU3IYVpeUzd/adh+cEk1LK31KMvYL67bJCrPfyBbWRGmDo3r1dPbNcs5aReHbLxAtYHNXzEvkG+7ng==",
"requires": {
"@babel/runtime-corejs3": "^7.10.4",
"core-js": "^3.6.5",
"friendly-pow": "0.1.2",
"object-assign-polyfill": "^0.1.0",
"promis": "^1.1.4",
"url-polyfill": "^1.1.10",
"whatwg-fetch": "^3.4.1"
}
},
"friendly-errors-webpack-plugin": { "friendly-errors-webpack-plugin": {
"version": "2.0.0-beta.2", "version": "2.0.0-beta.2",
"resolved": "https://registry.npmjs.org/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-2.0.0-beta.2.tgz", "resolved": "https://registry.npmjs.org/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-2.0.0-beta.2.tgz",
@ -12598,6 +12684,11 @@
} }
} }
}, },
"friendly-pow": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/friendly-pow/-/friendly-pow-0.1.2.tgz",
"integrity": "sha512-Ihnr6Ii9zDAPU0ylpRpjiWSIBUApuLOC8JtO7WMhh5Z5Fu+QjQHqZpV5tHwx3/pV3MOW20zSrGvdL05BpxpSjw=="
},
"fs-minipass": { "fs-minipass": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz",
@ -13753,6 +13844,11 @@
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
"dev": true "dev": true
}, },
"object-assign-polyfill": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/object-assign-polyfill/-/object-assign-polyfill-0.1.0.tgz",
"integrity": "sha1-K3Izj/aLdwzc2ngYYEhLuLL0CSA="
},
"object-inspect": { "object-inspect": {
"version": "1.10.2", "version": "1.10.2",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.2.tgz", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.2.tgz",
@ -14478,6 +14574,11 @@
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
"dev": true "dev": true
}, },
"promis": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/promis/-/promis-1.1.4.tgz",
"integrity": "sha1-DQ70PMrKzdj5Z5zW4JUPfH9SCWw="
},
"promise-inflight": { "promise-inflight": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz",
@ -14606,8 +14707,7 @@
"regenerator-runtime": { "regenerator-runtime": {
"version": "0.13.7", "version": "0.13.7",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz",
"integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew=="
"dev": true
}, },
"regenerator-transform": { "regenerator-transform": {
"version": "0.14.5", "version": "0.14.5",
@ -15644,6 +15744,11 @@
"querystring": "0.2.0" "querystring": "0.2.0"
} }
}, },
"url-polyfill": {
"version": "1.1.12",
"resolved": "https://registry.npmjs.org/url-polyfill/-/url-polyfill-1.1.12.tgz",
"integrity": "sha512-mYFmBHCapZjtcNHW0MDq9967t+z4Dmg5CJ0KqysK3+ZbyoNOWQHksGCTWwDhxGXllkWlOc10Xfko6v4a3ucM6A=="
},
"util-deprecate": { "util-deprecate": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
@ -15910,6 +16015,11 @@
"integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==",
"dev": true "dev": true
}, },
"whatwg-fetch": {
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz",
"integrity": "sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA=="
},
"which": { "which": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",

View file

@ -18,5 +18,8 @@
"dev": "encore dev", "dev": "encore dev",
"watch": "encore dev --watch", "watch": "encore dev --watch",
"build": "encore production --progress" "build": "encore production --progress"
},
"dependencies": {
"friendly-challenge": "^0.8.5"
} }
} }

View file

@ -17,6 +17,13 @@
}) }} }) }}
{{ form_row(registrationForm.agreeTerms) }} {{ form_row(registrationForm.agreeTerms) }}
<div class="form-group row">
<label class="col-form-label col-sm-2">CAPTCHA</label>
<div class="col-sm-10">
<div class="frc-captcha" data-sitekey="FCMLGE739LB528NG"></div>
</div>
</div>
<button type="submit" class="btn btn-lg btn-primary">Register</button> <button type="submit" class="btn btn-lg btn-primary">Register</button>
{{ form_end(registrationForm) }} {{ form_end(registrationForm) }}
{% endblock %} {% endblock %}

7538
yarn.lock

File diff suppressed because it is too large Load diff