diff --git a/docs/content/2.configuration/3.nuxt-auth-handler.md b/docs/content/2.configuration/3.nuxt-auth-handler.md index 6cb152b6..7ffd7fc8 100644 --- a/docs/content/2.configuration/3.nuxt-auth-handler.md +++ b/docs/content/2.configuration/3.nuxt-auth-handler.md @@ -11,9 +11,7 @@ This page is only relevant to you, if you are using the `authjs`-provider. After following the [quick-start setup](/nuxt-auth/v0.6/getting-started/quick-start) and then optionally diving even deeper into the [`nuxt-auth` config inside your `nuxt.config.ts`](/nuxt-auth/v0.6/configuration/nuxt-config) you can begin defining providers and other options inside your `NuxtAuthHandler`. For development, using the quick-start setup will already bring you quite far. For a production deployment, you will have to additionally: -- set the `origin` by: - 1. exporting the `AUTH_ORIGIN`-environment variable _at runtime_ (higher precedence) - 2. setting the `origin`-key inside the `nuxt.config.ts` config _at build-time_ (lower precendence) +- set the `origin` by exporting the `AUTH_ORIGIN`-environment variable _at runtime_ - set a secret inside the `NuxtAuthHandler` config ## Creating the `NuxtAuthHandler` diff --git a/docs/content/5.recipes/2.strapi.md b/docs/content/5.recipes/2.strapi.md index 81d01fc3..3aec076c 100644 --- a/docs/content/5.recipes/2.strapi.md +++ b/docs/content/5.recipes/2.strapi.md @@ -14,7 +14,7 @@ For a production deployment, you will have to at least set the: 1. Create a `.env` file with the following lines: ```env // Strapi v4 url, out of the box -ORIGIN=http://localhost:3000 +AUTH_ORIGIN=http://localhost:3000 NUXT_SECRET=a-not-so-good-secret STRAPI_BASE_URL=http://localhost:1337/api ``` @@ -28,9 +28,6 @@ export default defineNuxtConfig({ // Default http://localhost:1337/api STRAPI_BASE_URL: process.env.STRAPI_BASE_URL, }, - auth: { - origin: process.env.ORIGIN, - }, }); ``` diff --git a/docs/content/5.recipes/6.laravel-passport.md b/docs/content/5.recipes/6.laravel-passport.md index 41583bc8..72e43d28 100644 --- a/docs/content/5.recipes/6.laravel-passport.md +++ b/docs/content/5.recipes/6.laravel-passport.md @@ -68,8 +68,8 @@ export default defineNuxtConfig({ ```ts // ~/server/api/auth/[...].ts -import {NuxtAuthHandler} from '#auth' -const {passport} = useRuntimeConfig(); //get the values from the runtimeConfig +import { NuxtAuthHandler } from '#auth' +const { passport } = useRuntimeConfig(); //get the values from the runtimeConfig export default NuxtAuthHandler({ //... diff --git a/docs/content/5.recipes/7.vercel-deployment.md b/docs/content/5.recipes/7.vercel-deployment.md index dcb2fcd1..4085b885 100644 --- a/docs/content/5.recipes/7.vercel-deployment.md +++ b/docs/content/5.recipes/7.vercel-deployment.md @@ -20,11 +20,11 @@ In order to run the `nuxt-auth-example` the following environment variables are When deploying `nuxt-auth` to Vercel you cannot set a random string as your nuxt secret. You must use a 32-bit generated secret. You can use [this](https://generate-secret.vercel.app/32) website to generate a custom secret. -### ORIGIN +### AUTH_ORIGIN In order to set the correct origin go into your Vercel project settings and navigate to the `Domains` tab. Once there you will all the assigned domains and their assigned environment (production, dev). -Copy the correct domain for every enviroment and assign the environment variables to match the correct environment. +Copy the correct domain for every enviroment and assign the environment variables `AUTH_ORIGIN` to match the correct environment. ### Github_* diff --git a/docs/content/6.resources/5.errors.md b/docs/content/6.resources/5.errors.md index 15edfd94..5ed65729 100644 --- a/docs/content/6.resources/5.errors.md +++ b/docs/content/6.resources/5.errors.md @@ -27,9 +27,7 @@ Read [the `NuxtAuthHandler` docs for more information and different options you `AUTH_NO_ORIGIN` will appear as a warning message during development and be thrown as an error that stops the application during production. It is safe to ignore the development warning - it is only meant as a heads-up for your later production-deployment. `AUTH_NO_ORIGIN` occurs when the origin of your application was not set. `nuxt-auth` tries to find the origin of your application in the following order: 1. Use the `AUTH_ORIGIN` environment variable if it is set, -2. Use the `auth: { origin: 'https://your-cool-origin.com' }` config-value from the `nuxt.config.ts` if it is set, -3. Development only: Determine the origin automatically from the incoming HTTP request +2. Development only: Determine the origin automatically from the incoming HTTP request The `origin` is important for callbacks that happen to a specific origin for `oauth` flows. Note that in order for (2) to work the `origin` already has to be set at build-time, i.e., when you run `npm run build` or `npm run generate` and it will lead to the `origin` being inside your app-bundle. -Read [the `nuxt.config.ts` docs for more information and different options you can use to set the `origin` at build- and at runtime](/nuxt-auth/v0.6/configuration/nuxt-auth-handler).