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-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>
<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>

View File

@@ -6,7 +6,6 @@ export default defineNuxtConfig({
modules: ['nuxt-open-fetch', '@nuxt/ui', '@nuxt/eslint', '@zitadel/nuxt-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: {

View File

@@ -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`
}
}
})