-
-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation refers to wrong environment variable for AUTH_NO_ORIGIN error #906
Comments
Both these env variables are interchangeable. Prior to See code responsible for it: Extracting from nuxt-auth/src/runtime/server/services/utils.ts Lines 38 to 48 in ea5dfd6
From
|
Reopening after some consideration as it's apparently a legitimate bug. Nuxt filters out environment variables which are not defined on edit: you can fix it by including runtimeConfig: {
authOrigin: ''
} to your |
I thought Now it seems that my code is not wrong, but it took me a long time, so I record it here. Am I missing something? Can anyone tell me what's going on? my config
{
"name": "modulename",
"private": true,
"type": "module",
"license": "MIT",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev --host 0.0.0.0",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"dependencies": {
"@mdi/font": "^7.4.47",
"@nuxtjs/i18n": "^8.3.1",
"@nuxtjs/tailwindcss": "^6.12.2",
"@prisma/client": "^6.2.1",
"@prisma/nuxt": "^0.2.0",
"@sidebase/nuxt-auth": "^0.10.0",
"echarts": "^5.6.0",
"next-auth": "~4.21.1",
"nuxt": "^3.12.4",
"nuxt-echarts": "^0.2.4",
"vue": "latest",
"vuetify-nuxt-module": "^0.18.3",
"xlsx": "^0.18.5"
}
}
runtimeConfig: {
public: {},
appVersion: "",
appUrl: "",
dataPath: "",
authSecret: "",
authOrigin: "", // NUXT_AUTH_ORIGIN
},
modules: [
"@nuxtjs/i18n",
"vuetify-nuxt-module",
"@nuxtjs/tailwindcss",
"nuxt-echarts",
"@sidebase/nuxt-auth",
"@prisma/nuxt",
],
auth: {
// baseURL: process.env.NUXT_AUTH_ORIGIN,
// globalAppMiddleware: false,
// originEnvKey: "NUXT_AUTH_ORIGIN",
provider: {
type: "authjs",
trustHost: false,
addDefaultCallbackUrl: true,
},
sessionRefresh: {
enablePeriodically: false,
enableOnWindowFocus: true,
},
},
NUXT_AUTH_ORIGIN="http://localhost:9090/api/auth" Based on the above configuration, running ℹ AUTH_NO_ORIGIN: No origin - this is an error in production, see https://sidebase.io/nuxt-auth/resources/errors. You can ignore this during development This error is so annoying. |
Environment
not applicable
Reproduction
Start Nuxt using the
NUXT_AUTH_ORIGIN
value set in production.The
Error: AUTH_NO_ORIGIN: No
origin- this is an error in production
error will be thrown.Describe the bug
The documentation at https://auth.sidebase.io/resources/error-reference#auth-no-origin refers to the
NUXT_AUTH_ORIGIN
environment variable, but according to https://github.com/sidebase/nuxt-auth/blob/main/docs/guide/application-side/configuration.md?plain=1#L11 the environment variable needs to beAUTH_ORIGIN
.Changing the environment variable to
AUTH_ORIGIN
works with version0.9.2
.Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: