import Rails from '@rails/ujs';
import { Controller } from "stimulus"
export default class extends Controller {
static targets = [ "recaptchaToken" ]
greet() {
let recaptcha_token = this.recaptchaTokenTarget.value
Rails.ajax({
type: 'post',
url: 'http://localhost:3001/v3/email_authentication',
data: `recaptcha_token=${recaptcha_token}`,
dataType: 'json',
success: function(data) {
console.log(data);
},
error: function(data) {
alert(data);
}
})
}
}