Skip to content

docs: small update to sign in/out examples #1016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ export default NextAuth({
import React from 'react'
import {
useSession,
signin,
signout
signIn,
signOut
} from 'next-auth/client'

export default function myComponent() {
Expand All @@ -127,11 +127,11 @@ export default function myComponent() {
return <p>
{!session && <>
Not signed in <br/>
<button onClick={signin}>Sign in</button>
<button onClick={() => signIn()}>Sign in</button>
</>}
{session && <>
Signed in as {session.user.email} <br/>
<button onClick={signout}>Sign out</button>
<button onClick={() => signOut()}>Sign out</button>
</>}
</p>
}
Expand Down
4 changes: 2 additions & 2 deletions www/docs/getting-started/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ The `signIn()` method can be called from the client in different ways, as shown
import { signIn } from 'next-auth/client'

export default () => (
<button onClick={signIn}>Sign in</button>
<button onClick={() => signIn()}>Sign in</button>
)
```

Expand Down Expand Up @@ -224,7 +224,7 @@ It reloads the page in the browser when complete.
import { signOut } from 'next-auth/client'

export default () => (
<button onClick={signOut}>Sign out</button>
<button onClick={() => signOut()}>Sign out</button>
)
```

Expand Down
4 changes: 2 additions & 2 deletions www/docs/getting-started/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ export default function Page() {
return <>
{!session && <>
Not signed in <br/>
<button onClick={signIn}>Sign in</button>
<button onClick={() => signIn()}>Sign in</button>
</>}
{session && <>
Signed in as {session.user.email} <br/>
<button onClick={signOut}>Sign out</button>
<button onClick={() => signOut()}>Sign out</button>
</>}
</>
}
Expand Down
4 changes: 2 additions & 2 deletions www/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,11 @@ export default function myComponent() {
return <>
{!session && <>
Not signed in <br/>
<button onClick={signIn}>Sign in</button>
<button onClick={() => signIn()}>Sign in</button>
</>}
{session && <>
Signed in as {session.user.email} <br/>
<button onClick={signOut}>Sign out</button>
<button onClick={() => signOut()}>Sign out</button>
</>}
</>
}
Expand Down