use runtime config
All checks were successful
Build and Publish / build-release (push) Successful in 1m1s

This commit is contained in:
2026-05-14 15:52:33 -05:00
parent 2ed75599bc
commit fe91c2e8f1
3 changed files with 18 additions and 10 deletions

View File

@@ -46,11 +46,11 @@ async function loginWithZitadel() {
> >
<UIcon v-if="isLoading" name="i-heroicons-arrow-path" class="h-5 w-5 animate-spin" /> <UIcon v-if="isLoading" name="i-heroicons-arrow-path" class="h-5 w-5 animate-spin" />
<UIcon v-else name="i-heroicons-lock-closed" class="h-5 w-5" /> <UIcon v-else name="i-heroicons-lock-closed" class="h-5 w-5" />
<span>{{ isLoading ? 'Signing in...' : 'Sign in with Zitadel' }}</span> <span>{{ isLoading ? 'Signing in...' : 'Sign in with CorredorConect ID' }}</span>
</button> </button>
<div class="mt-6 text-center text-xs" style="color: var(--text-muted);"> <div class="mt-6 text-center text-xs" style="color: var(--text-muted);">
<p>Secure authentication powered by Zitadel</p> <p>Secure authentication powered by CorredorConect ID</p>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -6,7 +6,6 @@ export default defineNuxtConfig({
modules: ['nuxt-open-fetch', '@nuxt/ui', '@nuxt/eslint', '@zitadel/nuxt-auth'], modules: ['nuxt-open-fetch', '@nuxt/ui', '@nuxt/eslint', '@zitadel/nuxt-auth'],
auth: { auth: {
baseURL: '/api/auth', baseURL: '/api/auth',
origin: process.env.AUTH_ORIGIN,
provider: { provider: {
type: 'authjs', type: 'authjs',
trustHost: true, trustHost: true,
@@ -21,7 +20,13 @@ export default defineNuxtConfig({
ui: { ui: {
colorMode: false 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: { openFetch: {
clients: { clients: {
customer: { customer: {

View File

@@ -1,15 +1,18 @@
import { NuxtAuthHandler } from '#auth' import { NuxtAuthHandler } from '#auth'
import ZitadelProvider from '@auth/core/providers/zitadel' import ZitadelProvider from '@auth/core/providers/zitadel'
const config = useRuntimeConfig()
export default NuxtAuthHandler({ export default NuxtAuthHandler({
secret: process.env.AUTH_SECRET, secret: config.authSecret,
providers: [ providers: [
ZitadelProvider({ ZitadelProvider({
clientId: process.env.ZITADEL_CLIENT_ID, clientId: config.zitadelClientId,
issuer: process.env.ZITADEL_DOMAIN, issuer: config.zitadelDomain,
pkce: true,
authorization: { authorization: {
params: { 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`
} }
} }
}) })