Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DESCOPE_PROJECT_ID="<Descope Project ID>"
DESCOPE_ACCESS_KEY="<Descope Access Key>"
DESCOPE_DISCOVERY_URL="<Descope Discovery URL>"
NUXT_SECRET="<Your Nuxt Secret>"
ORIGIN="http://localhost:3000"
DESCOPE_PROJECT_ID=""
DESCOPE_ACCESS_KEY=""
DESCOPE_DISCOVERY_URL=""
NUXT_SECRET=""
ORIGIN=""
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ node_modules
.output
.env
dist
.vercel
56 changes: 56 additions & 0 deletions .vercel/output/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"version": 3,
"overrides": {},
"routes": [
{
"headers": {
"cache-control": "public, max-age=31536000, immutable"
},
"src": "/_nuxt/builds/meta/(.*)"
},
{
"headers": {
"cache-control": "public, max-age=1, immutable"
},
"src": "/_nuxt/builds/(.*)"
},
{
"headers": {
"cache-control": "public, max-age=31536000, immutable"
},
"src": "/_nuxt/(.*)"
},
{
"src": "/_nuxt/builds/meta(.*)",
"headers": {
"cache-control": "public,max-age=31536000,immutable"
},
"continue": true
},
{
"src": "/_nuxt/builds(.*)",
"headers": {
"cache-control": "public,max-age=31536000,immutable"
},
"continue": true
},
{
"src": "/_nuxt(.*)",
"headers": {
"cache-control": "public,max-age=31536000,immutable"
},
"continue": true
},
{
"handle": "filesystem"
},
{
"src": "/__nuxt_error",
"dest": "/__fallback"
},
{
"src": "/(.*)",
"dest": "/__fallback"
}
]
}
16 changes: 16 additions & 0 deletions .vercel/output/nitro.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"date": "2025-10-01T20:36:20.108Z",
"preset": "vercel",
"framework": {
"name": "nuxt",
"version": "3.14.1592"
},
"versions": {
"nitro": "2.12.6"
},
"commands": {
"preview": "",
"deploy": "npx vercel deploy --prebuilt"
},
"config": {}
}
Binary file added .vercel/output/static/img/descope-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="min-h-screen h-full relative bg-gray-100 pb-20">
<Navbar />
<NavBar />
<NuxtPage />
</div>
</template>
Expand Down
18 changes: 17 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,23 @@ export default defineNuxtConfig({
],
modules: ['@nuxtjs/tailwindcss', '@sidebase/nuxt-auth'],
auth: {
origin: process.env.ORIGIN,
origin: process.env.ORIGIN || 'http://localhost:3000',
enableGlobalAppMiddleware: true
},
Comment on lines 6 to +10

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auth.origin now defaults to http://localhost:3000 when ORIGIN is unset, so a deployed app without ORIGIN configured will build oauth callbacks/redirects against localhost instead of the real host and the callback will fail; can we keep the previous behavior (letting Nuxt Auth autodetect the host) or require ORIGIN explicitly?

Finding type: Breaking Changes | Severity: 🔴 High


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

In nuxt.config.ts around lines 6 to 10, the auth configuration currently sets origin to
a default ('http://localhost:3000') when process.env.ORIGIN is unset, which breaks OAuth
in deployed environments. Change this so the origin property is only included when
process.env.ORIGIN is defined (omit the origin key entirely when it's unset so Nuxt Auth
can autodetect), or alternatively enforce ORIGIN by throwing a clear error at build time
if it is missing. Implement this by conditionally building the auth object (e.g. only
add origin if process.env.ORIGIN) instead of assigning a localhost default.

components: {
global: true,
dirs: ['~/components']
},
nitro: {
preset: 'vercel'
},
vite: {
css: {
preprocessorOptions: {
scss: {
additionalData: '@use "sass:math";'
}
}
}
}
})
Loading
Loading