diff --git a/app/pages/login.vue b/app/pages/login.vue index b6fffba..3a31886 100644 --- a/app/pages/login.vue +++ b/app/pages/login.vue @@ -46,12 +46,12 @@ async function loginWithZitadel() { > - {{ isLoading ? 'Signing in...' : 'Sign in with Zitadel' }} + {{ isLoading ? 'Signing in...' : 'Sign in with CorredorConect ID' }}
-

Secure authentication powered by Zitadel

+

Secure authentication powered by CorredorConect ID

- \ No newline at end of file + diff --git a/nuxt.config.ts b/nuxt.config.ts index 9194e2b..6b52c0e 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -4,9 +4,8 @@ const devApiOrigin = 'https://dev.api.corredorconect.com' export default defineNuxtConfig({ compatibilityDate: '2026-02-25', modules: ['nuxt-open-fetch', '@nuxt/ui', '@nuxt/eslint', '@zitadel/nuxt-auth'], - auth: { + auth: { baseURL: '/api/auth', - origin: process.env.AUTH_ORIGIN, provider: { type: 'authjs', trustHost: true, @@ -21,7 +20,13 @@ export default defineNuxtConfig({ ui: { colorMode: false }, - runtimeConfig: {}, + runtimeConfig: { + authOrigin: process.env.AUTH_ORIGIN || '', + authSecret: process.env.AUTH_SECRET || '', + zitadelDomain: process.env.ZITADEL_DOMAIN || '', + zitadelClientId: process.env.ZITADEL_CLIENT_ID || '', + zitadelProjectId: process.env.ZITADEL_PROJECT_ID + }, openFetch: { clients: { customer: { diff --git a/server/api/auth/[...].ts b/server/api/auth/[...].ts index ddb5c27..f13abd5 100644 --- a/server/api/auth/[...].ts +++ b/server/api/auth/[...].ts @@ -1,15 +1,18 @@ import { NuxtAuthHandler } from '#auth' import ZitadelProvider from '@auth/core/providers/zitadel' +const config = useRuntimeConfig() + export default NuxtAuthHandler({ - secret: process.env.AUTH_SECRET, + secret: config.authSecret, providers: [ ZitadelProvider({ - clientId: process.env.ZITADEL_CLIENT_ID, - issuer: process.env.ZITADEL_DOMAIN, + clientId: config.zitadelClientId, + issuer: config.zitadelDomain, + pkce: true, authorization: { params: { - scope: `openid email profile offline_access urn:zitadel:iam:org:project:${process.env.ZITADEL_PROJECT_ID}:aud` + scope: `openid email profile offline_access urn:zitadel:iam:org:project:${config.projectId}:aud` } } })