Skip to content

Commit

Permalink
#22 ログアウト時のコールバックを設定
Browse files Browse the repository at this point in the history
  • Loading branch information
tmoka committed Nov 16, 2022
1 parent 5c63b06 commit f924095
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Header = () => {
<>
<Nav.Link href='/'>RTTWeb</Nav.Link>
<Nav.Link href='/signup'>新規登録</Nav.Link>
<Nav.Link onClick={() => signIn()}>ログイン</Nav.Link>
<Nav.Link onClick={() => signIn(undefined, { callbackUrl: `${process.env.NEXT_PUBLIC_BASE_URL}` })}>ログイン</Nav.Link>
</>
) : (
<>
Expand All @@ -55,7 +55,7 @@ const Header = () => {
id='basic-nav-dropdown'
>
<NavDropdown.Item>マイページ</NavDropdown.Item>
<NavDropdown.Item onClick={() => signOut()}>ログアウト</NavDropdown.Item>
<NavDropdown.Item onClick={() => signOut({ callbackUrl: `${process.env.NEXT_PUBLIC_BASE_URL}` })}>ログアウト</NavDropdown.Item>
</NavDropdown>
</>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const SessionComponent = () => {
<>
<h1>トップ画面(ログイン中)</h1>
ログインアカウント: {session?.user?.email} <br />
<Button onClick={() => signOut()}>Sign out</Button>{' '}
<Button onClick={() => signOut({ callbackUrl: `${process.env.NEXT_PUBLIC_BASE_URL}` })}>ログアウト</Button>{' '}
<Link href='/users'>
<Button>ユーザ一覧</Button>
</Link>
Expand Down

0 comments on commit f924095

Please sign in to comment.