1.0.2 • Published 1 year ago

nuxt-honeypot v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

nuxt-honeypot

Nuxt module for vue-honeypot.

Install

# npm
$ npm install nuxt-honeypot

# Yarn
$ yarn add nuxt-honeypot

Usage

Add the module to your nuxt.config.js:

export default {
  modules: [
    'nuxt-honeypot',
  ],
}

Now you can add the honeypot to your form:

<template>
  <form @submit="submit">
    <label for="email">Email</label>
    <input type="email" id="email" />

    <label for="password">Password</label>
    <input type="password" id="password" />

    <!-- Setup the honeypot -->
    <vue-honeypot ref="honeypot" />
  </form>
</template>

Then validate the honeypot in the submit function:

<script>
export default {
  methods: {
    submit() {
      try {
        this.$refs.honeypot.validate()
      } catch (error) {
        // error handling
      }
    },
  },
}
</script>
<template>
  <vue-mermaid-string :value="diagram" />
</template>
<script>
export default {
  computed: {
    diagram: () => 'graph TD\n    A --> B',
  },
}
</script>

Contribute

Are you missing something or want to contribute? Feel free to file an issue or a pull request! ⚙️

Support

Hey, I am Sebastian Landwehr, a freelance web developer, and I love developing web apps and open source packages. If you want to support me so that I can keep packages up to date and build more helpful tools, you can donate here:

Thanks a lot for your support! ❤️

License

MIT License © Sebastian Landwehr