From 7c2db2052af58c5e24d82b1a839d0b0a89eb03ed Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Sat, 16 Dec 2023 19:21:03 +0100 Subject: [PATCH] Figured out auth & middlewares --- client/components/global/Navbar.vue | 2 +- .../components/global/WorkspaceDropdown.vue | 2 +- .../pages/auth/components/LoginForm.vue | 1 - .../pages/templates/SingleTemplate.vue | 2 +- .../pages/templates/TemplatesList.vue | 4 +- client/composables/lib/vForm/Form.js | 4 +- client/composables/useAmplitude.js | 12 +- client/composables/useOpnApi.js | 49 + client/composables/useOpnFetch.js | 5 - client/data/country_code_mapper.json | 248 +++ client/data/country_codes.json | 1232 ++++++++++++ client/data/forms/templates/industries.json | 184 ++ client/data/forms/templates/types.json | 324 ++++ client/data/open_filters.json | 492 +++++ client/data/timezones.json | 1373 +++++++++++++ client/middleware/01.check-auth.global.js | 9 + client/middleware/admin.js | 7 +- client/middleware/auth.js | 5 +- client/middleware/check-auth.global.js | 5 - client/middleware/custom-domain.global.js | 16 + client/middleware/guest.js | 9 + client/middleware/subscribed.js | 7 + client/opnform.config.js | 5 +- client/package-lock.json | 1704 ++++++++--------- client/package.json | 3 - client/pages/home.vue | 86 +- client/pages/login.vue | 6 +- client/pages/templates.vue | 6 + .../pages/templates/{show.vue => [slug].vue} | 0 .../{industries-show.vue => industries.vue} | 2 +- .../templates/{types-show.vue => types.vue} | 2 +- client/plugins/fetch.js | 48 - client/stores/auth.js | 61 +- client/stores/forms.js | 10 +- client/stores/templates.js | 70 +- client/stores/workspaces.js | 16 +- resources/js/middleware/notion-connection.js | 19 - resources/js/middleware/role.js | 21 - 38 files changed, 4862 insertions(+), 1189 deletions(-) create mode 100644 client/composables/useOpnApi.js delete mode 100644 client/composables/useOpnFetch.js create mode 100644 client/data/country_code_mapper.json create mode 100644 client/data/country_codes.json create mode 100644 client/data/forms/templates/industries.json create mode 100644 client/data/forms/templates/types.json create mode 100644 client/data/open_filters.json create mode 100644 client/data/timezones.json create mode 100644 client/middleware/01.check-auth.global.js delete mode 100644 client/middleware/check-auth.global.js create mode 100644 client/middleware/custom-domain.global.js create mode 100644 client/middleware/guest.js create mode 100644 client/middleware/subscribed.js rename client/pages/templates/{show.vue => [slug].vue} (100%) rename client/pages/templates/{industries-show.vue => industries.vue} (99%) rename client/pages/templates/{types-show.vue => types.vue} (99%) delete mode 100644 client/plugins/fetch.js delete mode 100644 resources/js/middleware/notion-connection.js delete mode 100644 resources/js/middleware/role.js diff --git a/client/components/global/Navbar.vue b/client/components/global/Navbar.vue index 83913c8..af37c53 100644 --- a/client/components/global/Navbar.vue +++ b/client/components/global/Navbar.vue @@ -168,7 +168,7 @@ export default { return null }, workspace () { - return this.workspacesStore.getCurrent() + return this.workspacesStore.getCurrent }, paidPlansEnabled () { return this.config.paid_plans_enabled diff --git a/client/components/global/WorkspaceDropdown.vue b/client/components/global/WorkspaceDropdown.vue index b362bff..bd94041 100644 --- a/client/components/global/WorkspaceDropdown.vue +++ b/client/components/global/WorkspaceDropdown.vue @@ -69,7 +69,7 @@ export default { computed: { workspace () { - return this.workspacesStore.getCurrent() + return this.workspacesStore.getCurrent } }, diff --git a/client/components/pages/auth/components/LoginForm.vue b/client/components/pages/auth/components/LoginForm.vue index 2257f9d..a5343d8 100644 --- a/client/components/pages/auth/components/LoginForm.vue +++ b/client/components/pages/auth/components/LoginForm.vue @@ -41,7 +41,6 @@