Skip to content

Commit

Permalink
Fix: conversations is not a publicHead and fix auth redirect to not c…
Browse files Browse the repository at this point in the history
…lear history
  • Loading branch information
eleanorreem committed Dec 27, 2024
1 parent 9d0c0b5 commit 9d5404e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions guards/AuthGuard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,14 @@ export function AuthGuard({ children }: { children: JSX.Element }) {
if (
publicPathHeads.includes(pathHead) ||
partiallyPublicPages.includes(router.asPath) ||
router.asPath.includes('/conversations') ||
router.asPath.includes('/shorts')
) {
return <>{children}</>;
}

// Page requires authenticated user
if (unauthenticated && typeof window !== 'undefined') {
router.push(`/auth/login${generateReturnUrlQuery(router.asPath)}`);
router.replace(`/auth/login${generateReturnUrlQuery(router.asPath)}`);
}

if (userId) {
Expand Down

0 comments on commit 9d5404e

Please sign in to comment.