Base support for CAPTCHA (kocaptcha)

This commit is contained in:
Ekaterina Vaartis 2018-12-15 03:05:47 +03:00
parent 4b30ce64c9
commit 9303bd5d36
2 changed files with 23 additions and 1 deletions

View file

@ -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()