Set middleware on pages (#278)

* Se middleware on pages

* Se middleware on account page
This commit is contained in:
formsdev 2024-01-05 15:17:36 +05:30 committed by GitHub
parent 2207c8cd90
commit cc7d64a0c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 52 additions and 39 deletions

View File

@ -493,40 +493,21 @@
</div>
</template>
<script>
<script setup>
import { computed } from 'vue'
import { useAuthStore } from '../stores/auth'
export default {
layout: 'default',
const authStore = useAuthStore()
setup () {
useOpnSeoMeta({
title: 'Free AI form builder',
description: 'Transform your ideas into fully functional forms with OpnForm AI Builder quick, accurate, and tailored to fit any requirement.'
})
useOpnSeoMeta({
title: 'Free AI form builder',
description: 'Transform your ideas into fully functional forms with OpnForm AI Builder quick, accurate, and tailored to fit any requirement.'
})
defineRouteRules({
prerender: true
})
const authStore = useAuthStore()
defineRouteRules({
prerender: true
})
return {
authenticated : computed(() => authStore.check),
}
},
data: () => ({
}),
mounted() {},
methods: {},
computed: {
configLinks: () => this.$config.links
}
}
let authenticated = computed(() => authStore.check)
</script>
<style lang="scss" scoped>

View File

@ -24,9 +24,10 @@
<script>
export default {
middleware: 'guest',
setup () {
definePageMeta({
middleware: "guest"
})
useOpnSeoMeta({
title: 'Reset Password'
})

View File

@ -34,9 +34,10 @@
<script>
export default {
middleware: 'guest',
setup () {
definePageMeta({
middleware: "guest"
})
useOpnSeoMeta({
title: 'Reset Password'
})

View File

@ -22,7 +22,6 @@ import {hash} from "~/lib/utils.js";
export default {
name: 'EditForm',
components: { Breadcrumb, FormEditor },
middleware: 'auth',
beforeRouteLeave (to, from, next) {
if (this.isDirty()) {
@ -55,6 +54,9 @@ export default {
useOpnSeoMeta({
title: 'Edit ' + ((form && form.value) ? form.value.title : 'Your Form')
})
definePageMeta({
middleware: "auth"
})
return {
formsStore,

View File

@ -141,9 +141,10 @@ export default {
FormCleanings
},
middleware: 'auth',
setup () {
definePageMeta({
middleware: "auth"
})
useOpnSeoMeta({
title: 'Home'
})

View File

@ -45,6 +45,9 @@ export default {
},
setup (props) {
definePageMeta({
middleware: "auth"
})
useOpnSeoMeta({
title: (props.form) ? 'Share Form - '+props.form.title : 'Share Form'
})

View File

@ -18,6 +18,9 @@ export default {
},
setup (props) {
definePageMeta({
middleware: "auth"
})
useOpnSeoMeta({
title: (props.form) ? 'Form Analytics - '+props.form.title : 'Form Analytics'
})

View File

@ -14,6 +14,9 @@ export default {
},
setup (props) {
definePageMeta({
middleware: "auth"
})
useOpnSeoMeta({
title: (props.form) ? 'Form Submissions - '+props.form.title : 'Form Submissions'
})

View File

@ -51,6 +51,9 @@ const form = storeToRefs(workingFormStore).content
useOpnSeoMeta({
title: 'Create a new Form for free',
})
definePageMeta({
middleware: "guest"
})
// Data
const stateReady = ref(false)

View File

@ -76,8 +76,6 @@ export default {
})
},
middleware: 'guest',
data: () => ({
}),

View File

@ -25,6 +25,9 @@ let loading = false
useOpnSeoMeta({
title: 'Account'
})
definePageMeta({
middleware: "auth"
})
const deleteAccount = () => {
loading = true

View File

@ -27,6 +27,9 @@ import AppSumoBilling from '../../components/vendor/appsumo/AppSumoBilling.vue'
useOpnSeoMeta({
title: 'Billing'
})
definePageMeta({
middleware: "auth"
})
const authStore = useAuthStore()
let user = computed(() => authStore.user)

View File

@ -28,6 +28,9 @@
useOpnSeoMeta({
title: 'Password'
})
definePageMeta({
middleware: "auth"
})
let form = useForm({
password: '',

View File

@ -27,6 +27,9 @@ const user = computed(() => authStore.user)
useOpnSeoMeta({
title: 'Profile'
})
definePageMeta({
middleware: "auth"
})
let form = useForm({
name: '',

View File

@ -126,6 +126,9 @@ let loading = computed(() => workspacesStore.loading)
useOpnSeoMeta({
title: 'Workspaces'
})
definePageMeta({
middleware: "auth"
})
let form = useForm({
name: '',

View File

@ -22,9 +22,11 @@ import TemplatesList from '../../components/pages/templates/TemplatesList.vue'
export default {
components: { TemplatesList },
middleware: 'auth',
setup () {
definePageMeta({
middleware: "auth"
})
useOpnSeoMeta({
title: 'My Templates',
description: 'Our collection of beautiful templates to create your own forms!'