Skip to content

Commit 4a9d871

Browse files
authored
docs(www): add more algolia no-result terms (#2442)
1 parent c2119b1 commit 4a9d871

File tree

4 files changed

+30
-24
lines changed

4 files changed

+30
-24
lines changed

www/docs/configuration/events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The message will be an object and contain:
2525

2626
### signOut
2727

28-
Sent when the user signs out.
28+
Sent when the user signs out (logout).
2929

3030
The message object is the JWT, if using them, or the adapter session object for the session that is being ended.
3131

www/docs/getting-started/client.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ More information can be found in the following [Github Issue](https://github.com
467467
468468
### NextAuth.js + React-Query
469469
470-
There is also an alternative client-side API library based upon [`react-query`](https://www.npmjs.com/package/react-query) available under [`nextauthjs/react-query`](https://github.com/nextauthjs/react-query).
470+
There is also an alternative first-party client-side API library based upon [`react-query`](https://www.npmjs.com/package/react-query) available under [`nextauthjs/react-query`](https://github.com/nextauthjs/react-query).
471471
472472
If you use `react-query` in your project already, you can leverage it with NextAuth.js to handle the client-side session management for you as well. This replaces NextAuth.js's native `useSession` and `Provider` from `next-auth/client`.
473473

www/docs/getting-started/example.md

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ The easiest way to get started is to clone the [example app](https://github.com/
1313

1414
### Add API route
1515

16-
To add NextAuth.js to a project create a file called `[...nextauth].js` in `pages/api/auth`.
16+
To add NextAuth.js to a project create a file called `[...nextauth].js` in `pages/api/auth`. NextAuth.js requires no modification to the `next.config.js` file.
1717

1818
[Read more about how to add authentication providers.](/configuration/providers)
1919

2020
```javascript title="pages/api/auth/[...nextauth].js"
21-
import NextAuth from 'next-auth'
22-
import Providers from 'next-auth/providers'
21+
import NextAuth from "next-auth"
22+
import Providers from "next-auth/providers"
2323

2424
export default NextAuth({
2525
// Configure one or more authentication providers
2626
providers: [
2727
Providers.GitHub({
2828
clientId: process.env.GITHUB_ID,
29-
clientSecret: process.env.GITHUB_SECRET
29+
clientSecret: process.env.GITHUB_SECRET,
3030
}),
3131
// ...add more providers here
3232
],
@@ -47,21 +47,27 @@ See the [options documentation](/configuration/options) for how to configure pro
4747
The `useSession()` React Hook in the NextAuth.js client is the easiest way to check if someone is signed in.
4848

4949
```jsx title="pages/index.js"
50-
import { signIn, signOut, useSession } from 'next-auth/client'
50+
import { signIn, signOut, useSession } from "next-auth/client"
5151

5252
export default function Page() {
53-
const [ session, loading ] = useSession()
54-
55-
return <>
56-
{!session && <>
57-
Not signed in <br/>
58-
<button onClick={() => signIn()}>Sign in</button>
59-
</>}
60-
{session && <>
61-
Signed in as {session.user.email} <br/>
62-
<button onClick={() => signOut()}>Sign out</button>
63-
</>}
64-
</>
53+
const [session, loading] = useSession()
54+
55+
return (
56+
<>
57+
{!session && (
58+
<>
59+
Not signed in <br />
60+
<button onClick={() => signIn()}>Sign in</button>
61+
</>
62+
)}
63+
{session && (
64+
<>
65+
Signed in as {session.user.email} <br />
66+
<button onClick={() => signOut()}>Sign out</button>
67+
</>
68+
)}
69+
</>
70+
)
6571
}
6672
```
6773

@@ -74,9 +80,9 @@ You can use the `useSession` hook from anywhere in your application (e.g. in a h
7480
To allow session state to be shared between pages - which improves performance, reduces network traffic and avoids component state changes while rendering - you can use the NextAuth.js Provider in `pages/_app.js`.
7581

7682
```jsx title="pages/_app.js"
77-
import { Provider } from 'next-auth/client'
83+
import { Provider } from "next-auth/client"
7884

79-
export default function App ({ Component, pageProps }) {
85+
export default function App({ Component, pageProps }) {
8086
return (
8187
<Provider session={pageProps.session}>
8288
<Component {...pageProps} />

www/docs/getting-started/rest-api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ For OAuth 2.0 providers that support the `state` option, the value of the `state
2323

2424
#### `GET` /api/auth/signout
2525

26-
Displays the sign out page.
26+
Displays the sign out page allowing the user to logout.
2727

2828
#### `POST` /api/auth/signout
2929

@@ -54,9 +54,9 @@ It can be used to dynamically generate custom sign up pages and to check what ca
5454
:::note
5555
The default base path is `/api/auth` but it is configurable by specifying a custom path in `NEXTAUTH_URL`
5656

57-
e.g.
57+
e.g.
5858

59-
`NEXTAUTH_URL=https://example.com/myapp/api/authentication`
59+
`NEXTAUTH_URL=https://example.com/myapp/api/authentication`
6060

6161
`/api/auth/signin` -> `/myapp/api/authentication/signin`
6262
:::

0 commit comments

Comments
 (0)