Skip to content

Commit 6d13eb4

Browse files
authored
Merge branch 'main' into update-pull-request
2 parents a43147c + 429b615 commit 6d13eb4

File tree

6 files changed

+16
-13
lines changed

6 files changed

+16
-13
lines changed

docs/guide/application-side/session-access.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ await signUp(credentials, undefined, { preventLoginFlow: true })
182182
```
183183

184184
:::info
185-
You can also pass the `callbackUrl` option to redirect a user to a certain page, after he's completed the action. This can be useful when a user attempts to open a page (`/protected`) but has to go through external authentication (e.g., via their google account) first.
185+
You can also pass the `callbackUrl` option to redirect a user to a certain page, after they completed the action. This can be useful when a user attempts to open a page (`/protected`) but has to go through external authentication (e.g., via their google account) first.
186186
:::
187187

188188
:::warning Local / Refresh Only
@@ -229,7 +229,7 @@ await signIn(credentials, { callbackUrl: 'https://nuxt.org', external: true })
229229
:::
230230

231231
:::info
232-
You can also pass the `callbackUrl` option to redirect a user to a certain page, after he's completed the action. This can be useful when a user attempts to open a page (`/protected`) but has to go through external authentication (e.g., via their google account) first.
232+
You can also pass the `callbackUrl` option to redirect a user to a certain page, after they completed the action. This can be useful when a user attempts to open a page (`/protected`) but has to go through external authentication (e.g., via their google account) first.
233233
:::
234234

235235
### `signOut`
@@ -255,7 +255,7 @@ const { signOut } = useAuth()
255255
```
256256

257257
:::info
258-
You can also pass the `callbackUrl` option to redirect a user to a certain page, after he's completed the action. This can be useful when a user attempts to open a page (`/protected`) but has to go through external authentication (e.g., via their google account) first.
258+
You can also pass the `callbackUrl` option to redirect a user to a certain page, after they completed the action. This can be useful when a user attempts to open a page (`/protected`) but has to go through external authentication (e.g., via their google account) first.
259259
:::
260260

261261
### `refreshToken`

docs/guide/getting-started/choose-provider.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ If you are still unsure, below are some tables to help you pick:
3030
| Static apps ("nuxi generate") | ❌ | ✅ | ✅
3131
| [Guest mode](/guide/application-side/protecting-pages#guest-mode) | ✅ | ✅ | ✅
3232
| [App-side middleware](/guide/application-side/protecting-pages) | ✅ | ✅ | ✅
33-
| [Server-side middleware](/guide/authjs/server-side/session-access#endpoint-protection) | ✅ | |
33+
| [Server-side middleware](/guide/authjs/server-side/session-access#endpoint-protection) | ✅ | |
3434
| Pre-made login-page | ✅ (impacts bundle-size) | ❌ | ❌
3535
| Database-adapters, server-side callback-hooks | ✅ | ❌ | ❌
3636

docs/guide/local/quick-start.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,14 @@ To ensure that the module can properly identify that your endpoints point to an
9393
auth: {
9494
baseURL: 'https://external-api.com', // [!code --]
9595
baseURL: 'https://external-api.com/' // [!code ++]
96-
endpoints: {
97-
signIn: { path: '/login', method: 'post' }, // [!code --]
98-
signIn: { path: 'login', method: 'post' }, // [!code ++]
99-
getSession: { path: '/session', method: 'get' }, // [!code --]
100-
getSession: { path: 'session', method: 'get' }, // [!code ++]
96+
provider: {
97+
type: 'local',
98+
endpoints: {
99+
signIn: { path: '/login', method: 'post' }, // [!code --]
100+
signIn: { path: 'login', method: 'post' }, // [!code ++]
101+
getSession: { path: '/session', method: 'get' }, // [!code --]
102+
getSession: { path: 'session', method: 'get' }, // [!code ++]
103+
}
101104
}
102105
}
103106
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sidebase/nuxt-auth",
3-
"version": "0.8.0",
3+
"version": "0.8.1",
44
"license": "MIT",
55
"type": "module",
66
"exports": {

src/runtime/middleware/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ export default defineNuxtRouteMiddleware((to) => {
6666
return
6767
}
6868

69-
// We do not want to block the login page when the local provider is used
70-
if (authConfig.provider?.type === 'local') {
69+
// We do not want to block the login page when the local/refresh provider is used
70+
if (authConfig.provider?.type === 'local' || authConfig.provider?.type === 'refresh') {
7171
const loginRoute: string | undefined = authConfig.provider?.pages?.login
7272
if (loginRoute && loginRoute === to.path) {
7373
return

src/runtime/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
1313
// use runtimeConfig
1414
const runtimeConfig = useRuntimeConfig().public.auth
1515

16-
const routeRules = getNitroRouteRules(nuxtApp._route.path)
16+
const routeRules = import.meta.server ? getNitroRouteRules(nuxtApp._route.path) : {}
1717

1818
// Skip auth if we're prerendering
1919
let nitroPrerender = false

0 commit comments

Comments
 (0)