Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenix-ru authored Dec 19, 2024
1 parent 90eecc2 commit ea51698
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/guide/application-side/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
4 changes: 2 additions & 2 deletions docs/guide/local/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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',
Expand Down
10 changes: 5 additions & 5 deletions docs/upgrade/version-0.10.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

:::
Expand Down Expand Up @@ -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({
Expand All @@ -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

Expand Down

0 comments on commit ea51698

Please sign in to comment.