From 31fd5c755b4f9ff1c154b6c30472557cc2830404 Mon Sep 17 00:00:00 2001 From: Colin Hutchinson Date: Fri, 19 Jul 2024 10:43:21 -0400 Subject: [PATCH] fix(variables): centralize some variables --- app/nuxt.config.ts | 6 ++---- app/pages/index.vue | 4 +++- docker-compose.yml | 2 +- env.template | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/nuxt.config.ts b/app/nuxt.config.ts index 9d73376..cdc9605 100644 --- a/app/nuxt.config.ts +++ b/app/nuxt.config.ts @@ -3,9 +3,6 @@ export default defineNuxtConfig({ ssr: false, devtools: { enabled: true }, modules: ["@nuxt/ui", "@vite-pwa/nuxt", "nuxt-vue3-google-signin"], - googleSignIn: { - clientId: '753759858538-nufcl1qbhf9gpc7v9qs4seramd7ni2rm.apps.googleusercontent.com', - }, pwa: { manifest: { name: 'Boat Sharing App', @@ -44,7 +41,8 @@ export default defineNuxtConfig({ }, runtimeConfig: { public: { - googleCalendarId: '7417fba20bb0d2c726dba1575d7d6421014047d0dbfe15875c8dd3588796f8c6@group.calendar.google.com' + googleCalendarId: '7417fba20bb0d2c726dba1575d7d6421014047d0dbfe15875c8dd3588796f8c6@group.calendar.google.com', + oauthClientId: '753759858538-nufcl1qbhf9gpc7v9qs4seramd7ni2rm.apps.googleusercontent.com', } }, vite: { diff --git a/app/pages/index.vue b/app/pages/index.vue index 59d32c3..d15f4d6 100644 --- a/app/pages/index.vue +++ b/app/pages/index.vue @@ -22,8 +22,10 @@ const handleOnError = (errorResponse: AuthCodeFlowErrorResponse) => { console.log('Error: ', errorResponse); }; +const config = useRuntimeConfig() + const { login } = useTokenClient({ - client_id: '753759858538-nufcl1qbhf9gpc7v9qs4seramd7ni2rm.apps.googleusercontent.com', + client_id: config.public.oauthClientId, scope: 'profile email https://www.googleapis.com/auth/calendar', prompt: 'consent', onSuccess: handleOnSuccess, diff --git a/docker-compose.yml b/docker-compose.yml index f4ec2c5..e6d700c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,6 +21,6 @@ services: image: ngrok/ngrok environment: NGROK_AUTHTOKEN: ${NGROK_AUTHTOKEN} - command: http --domain=boatapp.ngrok.dev nuxt:3000 + command: http --domain=${NGROK_DOMAIN} nuxt:3000 ports: - "4040:4040" diff --git a/env.template b/env.template index fd7af92..48a0b11 100644 --- a/env.template +++ b/env.template @@ -1 +1,2 @@ NGROK_AUTHTOKEN=your-ngrok-auth-token +NGROK_DOMAIN=xxx