ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabaseโ€ข4y agoโ€ข
2 replies
user8923

withPageAuth, user is always undefined

What am I doing wrong here? Or is it a bug? The user variable is always undefined...

// index.tsx

import { User, withPageAuth } from "@supabase/auth-helpers-nextjs";

type HomePageProps =
    {
        user: User;
    };

export default function HomePage({ user }: HomePageProps)
{
    return <div>Hello { user.email }</div>;
}

export const getServerSideProps = withPageAuth({ redirectTo: "/login" });
// index.tsx

import { User, withPageAuth } from "@supabase/auth-helpers-nextjs";

type HomePageProps =
    {
        user: User;
    };

export default function HomePage({ user }: HomePageProps)
{
    return <div>Hello { user.email }</div>;
}

export const getServerSideProps = withPageAuth({ redirectTo: "/login" });
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

withPageAuth user undefined for authenticated user
SupabaseSSupabase / help-and-questions
4y ago
getserverSideProps withpageauth user undefined in nextjs subscription example and locally
SupabaseSSupabase / help-and-questions
4y ago
withPageAuth Dynamic Page
SupabaseSSupabase / help-and-questions
4y ago
Permission based withPageAuth
SupabaseSSupabase / help-and-questions
4y ago