-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement sign out button and redirect to sign in page when log…
…ging out
- Loading branch information
Showing
3 changed files
with
27 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use client'; | ||
|
||
import { SignOutButton as SignOutButtonClerk } from '@clerk/nextjs'; | ||
import { redirect } from 'next/navigation'; | ||
|
||
const SignOutButton = () => ( | ||
<SignOutButtonClerk signOutCallback={() => redirect('/')}> | ||
<button | ||
className="border-none text-gray-700 hover:text-gray-900" | ||
type="button" | ||
> | ||
Sign out | ||
</button> | ||
</SignOutButtonClerk> | ||
); | ||
|
||
export { SignOutButton }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters