X Enterprises

Configuration

app.config.ts and runtimeConfig reference for @xenterprises/nuxt-x-auth-local.

Configuration

app.config.ts

export default defineAppConfig({
  xAuth: {
    tokens: {
      accessCookie: 'x_auth_access',   // cookie name for access token
      refreshCookie: 'x_auth_refresh',  // cookie name for refresh token
      hasRefresh: true,                 // set false if your API has no refresh token
    },

    redirects: {
      login: '/auth/login',
      signup: '/auth/signup',
      afterLogin: '/',
      afterSignup: '/',
      afterLogout: '/auth/login',
      forgotPassword: '/auth/forgot-password',
    },

    features: {
      forgotPassword: true,
      signup: true,
    },

    ui: {
      showLogo: true,
      logoUrl: '',
      brandName: 'My App',
      tagline: '',
      layout: 'centered',          // 'centered' | 'split'
      background: {
        type: 'gradient',          // 'gradient' | 'image' | 'solid'
        imageUrl: '',
        overlayOpacity: 50,
      },
      card: {
        glass: false,
        glassIntensity: 'medium',  // 'subtle' | 'medium' | 'strong'
      },
      split: {
        heroPosition: 'left',      // 'left' | 'right'
        heroImageUrl: '',
        headline: '',
        subheadline: '',
        features: [],
      },
    },
  },
})

Schema Reference

KeyTypeDefaultDescription
tokens.accessCookiestring'x_auth_access'Cookie name for storing the access token.
tokens.refreshCookiestring'x_auth_refresh'Cookie name for storing the refresh token.
tokens.hasRefreshbooleantrueSet false if your API does not issue a refresh token.
redirects.loginstring'/auth/login'Path of the login page.
redirects.signupstring'/auth/signup'Path of the signup page.
redirects.afterLoginstring'/'Redirect destination after a successful login.
redirects.afterSignupstring'/'Redirect destination after a successful signup.
redirects.afterLogoutstring'/auth/login'Redirect destination after logout.
redirects.forgotPasswordstring'/auth/forgot-password'Path of the forgot-password page.
features.forgotPasswordbooleantrueEnable forgot-password flow.
features.signupbooleantrueEnable signup page and link.
ui.showLogobooleantrueShow logo in auth forms.
ui.logoUrlstring''Logo image URL.
ui.brandNamestring'My App'Brand name displayed in auth forms.
ui.taglinestring''Tagline displayed below brand name.
ui.layout'centered' | 'split''centered'Auth page layout style.
ui.background.type'gradient' | 'image' | 'solid''gradient'Background style for auth pages.
ui.background.imageUrlstring''Background image URL (when type is 'image').
ui.background.overlayOpacitynumber50Background overlay opacity (0–100).
ui.card.glassbooleanfalseEnable glass morphism on the auth card.
ui.card.glassIntensity'subtle' | 'medium' | 'strong''medium'Glass intensity when glass is enabled.
ui.split.heroPosition'left' | 'right''left'Hero panel position in split layout.
ui.split.heroImageUrlstring''Hero panel image URL.
ui.split.headlinestring''Hero panel headline text.
ui.split.subheadlinestring''Hero panel subheadline text.
ui.split.featuresarray[]Feature list shown in the hero panel.

Runtime Config / Environment Variables

Configure endpoints in nuxt.config.ts under runtimeConfig.public.localAuth. Each key maps to a NUXT_PUBLIC_LOCAL_AUTH_* environment variable.

VariableRequiredDescription
NUXT_PUBLIC_LOCAL_AUTH_BASE_URLYesBackend API base URL.
NUXT_PUBLIC_LOCAL_AUTH_LOGIN_ENDPOINTNoOverride default /auth/login.
NUXT_PUBLIC_LOCAL_AUTH_SIGNUP_ENDPOINTNoOverride default /auth/signup.
NUXT_PUBLIC_LOCAL_AUTH_LOGOUT_ENDPOINTNoOverride default /auth/logout.
NUXT_PUBLIC_LOCAL_AUTH_REFRESH_ENDPOINTNoOverride default /auth/refresh.
NUXT_PUBLIC_LOCAL_AUTH_USER_ENDPOINTNoOverride default /auth/me.
NUXT_PUBLIC_LOCAL_AUTH_FORGOT_PASSWORD_ENDPOINTNoOverride default /auth/forgot-password.
NUXT_PUBLIC_LOCAL_AUTH_RESET_PASSWORD_ENDPOINTNoOverride default /auth/reset-password.
NUXT_PUBLIC_LOCAL_AUTH_CHANGE_PASSWORD_ENDPOINTNoOverride default /auth/change-password.

runtimeConfig.public.localAuth defaults

KeyDefaultDescription
baseUrl""Backend API base URL (required).
loginEndpoint"/auth/login"POST endpoint for email/password login.
signupEndpoint"/auth/signup"POST endpoint for registration.
logoutEndpoint"/auth/logout"POST endpoint for logout.
refreshEndpoint"/auth/refresh"POST endpoint for token refresh.
userEndpoint"/auth/me"GET endpoint to fetch the current user.
forgotPasswordEndpoint"/auth/forgot-password"POST endpoint to request a reset email.
resetPasswordEndpoint"/auth/reset-password"POST endpoint to apply a new password.
changePasswordEndpoint"/auth/change-password"POST endpoint for authenticated password change.

AI Context

package: "@xenterprises/nuxt-x-auth-local"
config-key: xAuth
runtime-config-key: localAuth
use-when: >
  Configuring cookie names, redirect paths, feature flags (forgot password,
  signup), or UI appearance for nuxt-x-auth-local. Set NUXT_PUBLIC_LOCAL_AUTH_BASE_URL
  and optional endpoint overrides via runtimeConfig.public.localAuth to point
  the layer at your self-hosted JWT API server.
Copyright © 2026