use runtime config
All checks were successful
Build and Publish / build-release (push) Successful in 1m1s
All checks were successful
Build and Publish / build-release (push) Successful in 1m1s
This commit is contained in:
@@ -46,12 +46,12 @@ 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>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -4,9 +4,8 @@ const devApiOrigin = 'https://dev.api.corredorconect.com'
|
|||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
compatibilityDate: '2026-02-25',
|
compatibilityDate: '2026-02-25',
|
||||||
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: {
|
||||||
|
|||||||
@@ -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`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user