aboutsummaryrefslogtreecommitdiff
path: root/src/components/registration/registration.js
diff options
context:
space:
mode:
authorEkaterina Vaartis <vaartis@cock.li>2018-12-15 03:05:47 +0300
committerEkaterina Vaartis <vaartis@cock.li>2018-12-15 03:05:47 +0300
commit9303bd5d36181d4516a31a4521a05d5003337a47 (patch)
tree3f6d152e3aa41168e7404a3759d5d71e8402bf7c /src/components/registration/registration.js
parent4b30ce64c9f7e90a8d8fb374b91e33916da179f5 (diff)
Base support for CAPTCHA (kocaptcha)
Diffstat (limited to 'src/components/registration/registration.js')
-rw-r--r--src/components/registration/registration.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/components/registration/registration.js b/src/components/registration/registration.js
index e5ead8bc..c4e96b3c 100644
--- a/src/components/registration/registration.js
+++ b/src/components/registration/registration.js
@@ -11,7 +11,8 @@ const registration = {
username: '',
password: '',
confirm: ''
- }
+ },
+ captcha: {}
}),
validations: {
user: {
@@ -29,6 +30,13 @@ const registration = {
if ((!this.registrationOpen && !this.token) || this.signedIn) {
this.$router.push('/main/all')
}
+
+ fetch("/api/pleroma/captcha")
+ .then(resp => resp.json())
+ .then(resp => {
+ // TODO: check for errors
+ this.captcha = resp
+ })
},
computed: {
token () { return this.$route.params.token },
@@ -45,6 +53,8 @@ const registration = {
async submit () {
this.user.nickname = this.user.username
this.user.token = this.token
+ this.user.captcha_solution = this.captcha.solution;
+ this.user.captcha_token = this.captcha.token;
this.$v.$touch()