Skip to content

Commit

Permalink
fix: auth issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gaboesquivel committed Apr 8, 2024
1 parent bcebd09 commit 842430e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/masterbots.ai/app/c/[chatbot]/[threadId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default async function ChatPage({ params }: ChatPageProps) {
} = await supabase.auth.getUser()
if (!user || !user.email) throw new Error('user not found')

const jwt = cookies().get('hasuraJwt').value || ''
const jwt = cookies().get('hasuraJwt')?.value || ''

console.log({ jwt, expired: isTokenExpired(jwt), user })
// NOTE: maybe we should use same expiration time
Expand Down
2 changes: 1 addition & 1 deletion apps/masterbots.ai/app/c/[chatbot]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default async function BotThreadsPage({
})

if (!userProfile) throw new Error('user not found')
const jwt = cookies().get('hasuraJwt').value || ''
const jwt = cookies().get('hasuraJwt')?.value || ''

// NOTE: maybe we should use same expiration time
if (!jwt || isTokenExpired(jwt) || !user) redirect(`/auth/sign-in?next=/c`)
Expand Down
4 changes: 1 addition & 3 deletions apps/masterbots.ai/app/c/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ interface ChatLayoutProps {
export default async function ChatLayout({ children }: ChatLayoutProps) {
return (
<main className="relative flex flex-col h-[calc(100vh_-_theme(spacing.16))] overflow-hidden">
{/* TODO: https://github.com/TheSGJ/nextjs-toploader/issues/66 */}
{/* <NextTopLoader color="#1ED761" initialPosition={0.20} /> */}
<ResponsiveSidebar />
<ChatLayoutSection>{children}</ChatLayoutSection>
{/* <ChatLayoutSection>{children}</ChatLayoutSection> */}
<div className="block lg:hidden">
<FooterCT />
</div>
Expand Down

0 comments on commit 842430e

Please sign in to comment.