Skip to content

Commit

Permalink
Temporarly fixed client components auth
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtoszBart committed Mar 12, 2024
1 parent 84a8d32 commit 666a3a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ yarn-error.log*
next-env.d.ts

.vercel
.env
14 changes: 7 additions & 7 deletions src/auth/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ export async function loginIsRequiredServer() {
if (!session) return redirect('/');
}

export async function loginIsRequiredClient() {
if (typeof window !== 'undefined') {
const session = useSession();
const router = useRouter();
if (!session) router.push('/');
}
}
// export async function loginIsRequiredClient() {
// if (typeof window !== 'undefined') {
// const session = useSession();
// const router = useRouter();
// if (!session) router.push('/');
// }
// }

0 comments on commit 666a3a7

Please sign in to comment.