Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to browse before having to signup/login #278

Merged
merged 8 commits into from
Jul 13, 2024
Prev Previous commit
Next Next commit
feat: avoid redirecting to login from home
  • Loading branch information
mnixo committed Jul 5, 2024
commit 5ba2d05ff350858a5f4e9756b6437c85516b841c
8 changes: 0 additions & 8 deletions app/(dashboard)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import Header from '@/components/Header';
import { createServerComponentClient } from '@supabase/auth-helpers-nextjs';
import { redirect } from 'next/navigation';
import { cookies } from 'next/headers';
import Footer from '@/components/Footer';
import Providers from '@/context/Providers';
import FullHeightContainer from '@/components/layout/FullHeightComponent';
Expand All @@ -11,11 +8,6 @@ export default async function DashBoardLayout({
}: {
children: React.ReactNode;
}) {
const supabase = createServerComponentClient({ cookies });
const { data } = await supabase.auth.getSession();
if (!data.session) {
redirect('/login');
}
return (
<>
<Providers>
Expand Down