Skip to content

Commit

Permalink
fix(next-sample): use location assign for sign in redirect (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangsijie authored Mar 31, 2023
1 parent f8e4e4f commit 6286eff
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/next-sample/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,21 @@ const Home = () => {
</header>
<nav>
{data?.isAuthenticated ? (
<Link href="/api/logto/sign-out">Sign Out</Link>
<button
onClick={() => {
window.location.assign('/api/logto/sign-out');
}}
>
Sign Out
</button>
) : (
<Link href="/api/logto/sign-in">Sign In</Link>
<button
onClick={() => {
window.location.assign('/api/logto/sign-in');
}}
>
Sign In
</button>
)}
</nav>
{claims}
Expand Down

0 comments on commit 6286eff

Please sign in to comment.