1.0.7 • Published 5 years ago

vue2-recaptchav3 v1.0.7

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

Vue2 Google Recaptcha V3

Usage in form:

<form>
<input type="hidden" name="token" v-model="googleToken" />
<GoogleCaptcha sitekey="yourSiteKey" action="yourPageAction" v-on:google_captcha_token="updateToken" ref="captcha"></GoogleCaptcha>
</form>

Import statement and event handling:

<script>
import GoogleCaptcha from 'vue2-recaptchav3';
export default {
    data(){
        return {
            googleToken: null,
            ...
        }
    },
    methods: {
        updateToken(payload){
          this.googleToken = payload.response_token;
        },
        formSubmit(){
            this.$refs.captcha.generateManualToken().then((token) => {
                //use token here
            });
        }
        ...
    }
}
</script>

Every time the action changes a new token is generated.

This allows you to generate tokens based on the page the user is on or based on each individual form

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago