Appsumo (#232)
* Implemented webhooks * oAuth wip * Implement the whole auth flow * Implement file upload limit depending on appsumo license
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<form @submit.prevent="register" @keydown="form.onKeydown($event)" class="mt-4">
|
||||
<form class="mt-4" @submit.prevent="register" @keydown="form.onKeydown($event)">
|
||||
<!-- Name -->
|
||||
<text-input name="name" :form="form" :label="$t('name')" placeholder="Your name" :required="true" />
|
||||
|
||||
@@ -18,42 +18,42 @@
|
||||
|
||||
<!-- Password Confirmation-->
|
||||
<text-input native-type="password" :form="form" :required="true" placeholder="Enter confirm password"
|
||||
name="password_confirmation" :label="$t('confirm_password')"
|
||||
name="password_confirmation" :label="$t('confirm_password')"
|
||||
/>
|
||||
|
||||
<checkbox-input :form="form" name="agree_terms" :required="true">
|
||||
<template #label>
|
||||
I agree with the <router-link :to="{name:'terms-conditions'}" target="_blank">Terms and conditions</router-link> and <router-link :to="{name:'privacy-policy'}" target="_blank">Privacy policy</router-link> of the website and I accept them.
|
||||
I agree with the <router-link :to="{name:'terms-conditions'}" target="_blank">
|
||||
Terms and conditions
|
||||
</router-link> and <router-link :to="{name:'privacy-policy'}" target="_blank">
|
||||
Privacy policy
|
||||
</router-link> of the website and I accept them.
|
||||
</template>
|
||||
</checkbox-input>
|
||||
|
||||
<!-- Submit Button -->
|
||||
<v-button :loading="form.busy">Create an account</v-button>
|
||||
<v-button :loading="form.busy">
|
||||
Create an account
|
||||
</v-button>
|
||||
|
||||
<p class="text-gray-500 mt-4">
|
||||
Already have an account?
|
||||
<a href="#" v-if="isQuick" @click.prevent="$emit('openLogin')" class="font-semibold ml-1">Log In</a>
|
||||
<router-link v-else :to="{name:'login'}" class="font-semibold ml-1">Log In</router-link>
|
||||
Already have an account?
|
||||
<a v-if="isQuick" href="#" class="font-semibold ml-1" @click.prevent="$emit('openLogin')">Log In</a>
|
||||
<router-link v-else :to="{name:'login'}" class="font-semibold ml-1">
|
||||
Log In
|
||||
</router-link>
|
||||
</p>
|
||||
|
||||
<!-- GitHub Register Button -->
|
||||
<login-with-github />
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Form from 'vform'
|
||||
import LoginWithGithub from '~/components/LoginWithGithub.vue'
|
||||
import SelectInput from '../../../components/forms/SelectInput.vue'
|
||||
import { initCrisp } from '../../../middleware/check-auth.js'
|
||||
|
||||
export default {
|
||||
name: 'RegisterForm',
|
||||
components: {
|
||||
SelectInput,
|
||||
LoginWithGithub,
|
||||
},
|
||||
components: {},
|
||||
props: {
|
||||
isQuick: {
|
||||
type: Boolean,
|
||||
@@ -68,7 +68,8 @@ export default {
|
||||
email: '',
|
||||
password: '',
|
||||
password_confirmation: '',
|
||||
agree_terms: false
|
||||
agree_terms: false,
|
||||
appsumo_license: null
|
||||
}),
|
||||
mustVerifyEmail: false
|
||||
}),
|
||||
@@ -91,6 +92,13 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
// Set appsumo license
|
||||
if (this.$route.query.appsumo_license !== undefined && this.$route.query.appsumo_license) {
|
||||
this.form.appsumo_license = this.$route.query.appsumo_license
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
async register () {
|
||||
// Register the user.
|
||||
@@ -111,14 +119,23 @@ export default {
|
||||
|
||||
// Track event
|
||||
this.$logEvent('register', { source: this.form.hear_about_us })
|
||||
|
||||
|
||||
initCrisp(data)
|
||||
this.$crisp.push(['set', 'session:event', [[['register', {}, 'blue']]]])
|
||||
|
||||
// AppSumo License
|
||||
if (data.appsumo_license === false) {
|
||||
this.alertError('Invalid AppSumo license. This probably happened because this license was already' +
|
||||
' attached to another OpnForm account. Please contact support.')
|
||||
} else if (data.appsumo_license === true) {
|
||||
this.alertSuccess('Your AppSumo license was successfully activated! You now have access to all the' +
|
||||
' features of the AppSumo deal.')
|
||||
}
|
||||
|
||||
// Redirect
|
||||
if(this.isQuick){
|
||||
if (this.isQuick) {
|
||||
this.$emit('afterQuickLogin')
|
||||
}else{
|
||||
} else {
|
||||
this.$router.push({ name: 'forms.create' })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,16 +3,17 @@
|
||||
<div class="flex mt-6 mb-10">
|
||||
<div class="w-full md:max-w-6xl mx-auto px-4 flex items-center md:flex-row-reverse flex-wrap">
|
||||
<div class="w-full lg:w-1/2 md:p-6">
|
||||
<app-sumo-register class="mb-10 p-6 lg:hidden" />
|
||||
<div class="border rounded-md p-6 shadow-md sticky top-4">
|
||||
<h2 class="font-semibold text-2xl">
|
||||
Create an account
|
||||
</h2>
|
||||
<small>Sign up in less than 2 minutes.</small>
|
||||
|
||||
<register-form />
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full hidden lg:block lg:w-1/2 md:p-6 mt-8 md:mt-0 ">
|
||||
<app-sumo-register class="mb-10" />
|
||||
<h1 class="font-bold">
|
||||
Create beautiful forms and share them anywhere
|
||||
</h1>
|
||||
@@ -22,7 +23,7 @@
|
||||
<div class="flex flex-wrap justify-center">
|
||||
<p class="px-3 pb-3 text-sm text-gray-500">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 inline" fill="none" viewBox="0 0 24 24"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
|
||||
</svg>
|
||||
@@ -30,7 +31,7 @@
|
||||
</p>
|
||||
<p class="px-3 pb-3 text-sm text-gray-500">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 inline" fill="none" viewBox="0 0 24 24"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
|
||||
</svg>
|
||||
@@ -38,16 +39,16 @@
|
||||
</p>
|
||||
<p class="px-3 pb-3 text-sm text-gray-500">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 inline" fill="none" viewBox="0 0 24 24"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
|
||||
</svg>
|
||||
Unlimited submissions
|
||||
</p>
|
||||
</div>
|
||||
<!-- <div class="mt-3 p-6">-->
|
||||
<!-- <testimonials />-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="mt-3 p-6">-->
|
||||
<!-- <testimonials />-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -57,29 +58,27 @@
|
||||
|
||||
<script>
|
||||
import OpenFormFooter from '../../components/pages/OpenFormFooter.vue'
|
||||
import Testimonials from '../../components/pages/welcome/Testimonials.vue'
|
||||
import RegisterForm from './components/RegisterForm.vue'
|
||||
import SeoMeta from '../../mixins/seo-meta.js'
|
||||
import AppSumoRegister from '../../components/vendor/appsumo/AppSumoRegister.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Testimonials,
|
||||
AppSumoRegister,
|
||||
OpenFormFooter,
|
||||
RegisterForm
|
||||
},
|
||||
|
||||
middleware: 'guest',
|
||||
|
||||
mixins: [SeoMeta],
|
||||
|
||||
middleware: 'guest',
|
||||
|
||||
data: () => ({
|
||||
metaTitle: 'Register',
|
||||
metaTitle: 'Register'
|
||||
}),
|
||||
|
||||
computed: {
|
||||
},
|
||||
computed: {},
|
||||
|
||||
methods: {
|
||||
}
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user