@dakingindanorf/hive
Version:
A template for creating a nuxt generated static site using Netlify CMS to power the backend. Individual site components can be managed through Bit
29 lines (25 loc) • 900 B
JavaScript
import Vue from 'vue'
const HiveKeyGen = ({ app }, inject) => {
const generateLicense = async(email) => {
// TODO: update intent metadata with license key from cryptllex
await app.$axios.post('/.netlify/functions/license-generate')
.then((data) => {
app.$updateIntent('license', data)
}).catch((error) => {
console.log('ERR ' + error.response.data)
})
}
inject('generateLicense', generateLicense)
const verifyLicense = async(email) => {
await app.$axios.post('/.netlify/functions/license-verify')
.then((data) => {
}).catch((error) => {
console.log('ERR ' + error.response.data)
})
}
inject('verifyLicense', verifyLicense)
}
export default HiveKeyGen
if (typeof window !== 'undefined' && window.Vue) {
Vue.use(HiveKeyGen)
}