You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/3.application-side/3.custom-sign-in-page.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ To create a custom sign-in page you will need to:
9
9
10
10
To create your custom sign-in page you can use `signIn` to directly start a provider-flow once the user selected it, e.g., by clicking on a button on your custom sign-in page. Here is a very simple sign-in page that either directly starts a github-oauth sign-in flow or directly signs in the user via the credentials flow:
11
11
::alert{type="info"}
12
-
In v0.5.0 of nuxt-auth `useSession()`will be renamed to `useAuth()`.
12
+
Prior to v0.5.0 `useAuth()`was called `useSession()`.
13
13
::
14
14
```vue
15
15
<!-- file: ~/pages/login.vue -->
@@ -30,7 +30,7 @@ definePageMeta({
30
30
}
31
31
})
32
32
33
-
const { signIn } = useSession()
33
+
const { signIn } = useAuth()
34
34
</script>
35
35
```
36
36
@@ -89,10 +89,10 @@ Above we use the [guest mode](/nuxt-auth/application-side/guest-mode). This opti
89
89
90
90
You can handle sign-in errors yourself by calling `signIn` with `redirect: false` and inspecting its result for errors. For example:
91
91
::alert{type="info"}
92
-
In v0.5.0 of nuxt-auth `useSession()`will be renamed to `useAuth()`.
92
+
Prior to v0.5.0 `useAuth()`was called `useSession()`.
Copy file name to clipboardExpand all lines: docs/content/3.application-side/4.protecting-pages.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,7 +88,7 @@ Creating a custom middleware is an advanced, experimental option and may result
88
88
89
89
To implement your custom middleware:
90
90
1. Create an application-side middleware that applies either globally or is named (see [the Nuxt docs for more](https://nuxt.com/docs/guide/directory-structure/middleware#middleware-directory))
91
-
2. Add logic based on `useSession` to it
91
+
2. Add logic based on `useAuth` to it
92
92
93
93
When adding the logic, you need to watch out when calling other `async` composable functions. This can lead to `context`-problems in Nuxt, see [the explanation for this here](https://github.com/nuxt/framework/issues/5740#issuecomment-1229197529). In order to avoid these problems, you will need to either:
94
94
- use the undocumented `callWithNuxt` utility when `await`ing other composables,
@@ -99,7 +99,7 @@ Following are examples of both kinds of usage:
99
99
```ts [direct return]
100
100
// file: ~/middleware/authentication.global.ts
101
101
exportdefaultdefineNuxtRouteMiddleware((to) => {
102
-
const { status, signIn } =useSession()
102
+
const { status, signIn } =useAuth()
103
103
104
104
// Return immeadiatly if user is already authenticated
Copy file name to clipboardExpand all lines: docs/content/4.server-side/4.rest-api.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ All endpoints that NextAuth.js supports are also supported by `nuxt-auth`:
14
14
15
15
The `basePath` is `/api/auth` per default and [can be configured in the `nuxt.config.ts`](/nuxt-auth/configuration/nuxt-config).
16
16
17
-
You can directly interact with these API endpoints if you wish to, it's probably a better idea to use `useSession` where possible though. [See the full rest API documentation of NextAuth.js here](https://next-auth.js.org/getting-started/rest-api).
17
+
You can directly interact with these API endpoints if you wish to, it's probably a better idea to use `useAuth` where possible though. [See the full rest API documentation of NextAuth.js here](https://next-auth.js.org/getting-started/rest-api).
18
18
::alert{type="info"}
19
-
In v0.5.0 of nuxt-auth `useSession()`will be renamed to `useAuth()`.
19
+
Prior to v0.5.0 `useAuth()`was called `useSession()`.
-[Various comments, proposals, ... of this thread](https://github.com/nextauthjs/next-auth/discussions/3942), special thanks to @brillout for starting the discussion, @balazsorban44 for NextAuth.js and encouraging the discussion, @wobsoriano for adding PoCs for multiple languages
16
16
17
-
The main part of the work was to piece everything together, resolve some outstanding issues with existing PoCs, add new things where nothing existed yet, e.g., for the `useSession` composable by going through the NextAuth.js client code and translating it to a Nuxt 3 approach.
17
+
The main part of the work was to piece everything together, resolve some outstanding issues with existing PoCs, add new things where nothing existed yet, e.g., for the `useAuth` composable by going through the NextAuth.js client code and translating it to a Nuxt 3 approach.
18
18
19
-
The module had another big iteration in collaboration with @JoaoPedroAS51 to make `useSession` a sync operation and trigger the session lifecycle from a plugin rather than the `useSession` composable itself.
19
+
The module had another big iteration in collaboration with @JoaoPedroAS51 to make `useAuth` a sync operation and trigger the session lifecycle from a plugin rather than the `useAuth` composable itself.
0 commit comments