From ea51698ba10bff9b12575d1ba2a1a760bc941d5e Mon Sep 17 00:00:00 2001 From: Marsel Shaikhin <18054980+phoenix-ru@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:55:35 +0100 Subject: [PATCH] Apply suggestions from code review --- docs/guide/application-side/configuration.md | 2 +- docs/guide/local/quick-start.md | 4 ++-- docs/upgrade/version-0.10.0.md | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/guide/application-side/configuration.md b/docs/guide/application-side/configuration.md index 7e54bd8a..e20391f7 100644 --- a/docs/guide/application-side/configuration.md +++ b/docs/guide/application-side/configuration.md @@ -64,7 +64,7 @@ Forces your server to send a "loading" authentication status on all requests, th - **Type**: `string | undefined` -The full url at which the app will run combined with the path to authentication. You should only use `baseURL` if you want to staticlly set a baseURL for your application. +The full URL at which the app will run combined with the path to authentication. You should only use `baseURL` if you want to set it statically for your application. You can read additional information on `origin` and `baseURL` determining [here](/resources/error-reference#auth-no-origin). diff --git a/docs/guide/local/quick-start.md b/docs/guide/local/quick-start.md index 37122492..63aa1d29 100644 --- a/docs/guide/local/quick-start.md +++ b/docs/guide/local/quick-start.md @@ -44,7 +44,7 @@ export default defineNuxtConfig({ Each endpoint, consists of an object, with a `path` and `method`. When a user triggers an action inside your application a request will be made to each endpoint. When a request is made to the `getSession` endpoint, a token will be sent as a header. You can configure the headers and token below. -In the example above, we define a runtimeConfig value with the `baseURl` using the originEnvKey, which results in requests being made to the following urls: +In the example above, we define a [runtime config](https://nuxt.com/docs/guide/going-further/runtime-config) value with the `baseURL` using the `originEnvKey`, which results in requests being made to the following URLs: - **Sign in:** `/api/auth/login` (POST) - **Sign out** `/api/auth/logout` (POST) @@ -78,7 +78,7 @@ You can also set your endpoints to query an external backend: export default defineNuxtConfig({ // ...Previous configuration runtimeConfig: { - baseURL: 'https://example-api.com' + baseURL: 'https://example.com/api' }, auth: { originEnvKey: 'NUXT_BASE_URL', diff --git a/docs/upgrade/version-0.10.0.md b/docs/upgrade/version-0.10.0.md index 8b913db3..f5027baf 100644 --- a/docs/upgrade/version-0.10.0.md +++ b/docs/upgrade/version-0.10.0.md @@ -11,11 +11,11 @@ npm i -D @sidebase/nuxt-auth@^0.10.0 ``` ```bash [pnpm] -pnpm i -D @sidebase/nuxt-auth^0.10.0 +pnpm i -D @sidebase/nuxt-auth@^0.10.0 ``` ```bash [yarn] -yarn add --dev @sidebase/nuxt-auth^0.10.0 +yarn add --dev @sidebase/nuxt-auth@^0.10.0 ``` ::: @@ -86,9 +86,9 @@ NUXT_BASE_URL="https://my-backend.com/api/auth" // [!code ++] ### Adjustments when using an external backend for the `local`-provider -In previous versions of `@sidebase/nuxt-auth` a very specific setup was needed to ensure that external backends could properly be used for the `local`-provider. In 0.10.0 we reworked the internal handling or urls to make it more consistent across providers and configurations. +In previous versions of `@sidebase/nuxt-auth` a very specific setup was needed to ensure that external backends could properly be used for the `local` provider. In 0.10.0 we reworked the internal handling or URLs to make it more consistent across providers and configurations. -If you were previously using an external backend you can now make the following adjustments: +If you were previously using an external backend, you can now prefix endpoint paths with a `/`: ```ts diff export default defineNuxtConfig({ @@ -106,7 +106,7 @@ export default defineNuxtConfig({ }) ``` -You can find a full overview of how `@sidebase/nuxt-auth`handles urls [here](https://github.com/sidebase/nuxt-auth/pull/913#issuecomment-2359137989). +You can find a full overview of how `@sidebase/nuxt-auth` handles URLs [here](https://github.com/sidebase/nuxt-auth/pull/913#issuecomment-2359137989) and in spec files for [`authjs` provider](https://github.com/sidebase/nuxt-auth/blob/main/tests/authjs.url.spec.ts) and [`local` provider](https://github.com/sidebase/nuxt-auth/blob/main/tests/local.url.spec.ts). ## Changelog