Skip to content

Commit

Permalink
docs: small update to sign in/out examples (#1016)
Browse files Browse the repository at this point in the history
* Update examples in client.md

* Update more examples

Co-authored-by: Balázs Orbán <[email protected]>
  • Loading branch information
melanieseltzer and balazsorban44 authored Jan 1, 2021
1 parent 82d16e6 commit c684336
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
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

0 comments on commit c684336

Please sign in to comment.