© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
14 replies
Kingfush

supabase auth.getUser always returns null

hi guys, trying to get current user in getServerSideProps with next.js but it's always returning null.

import { supabase } from "../lib/supabase";

const {
      data: { user },
    } = await supabase.auth.getUser();
import { supabase } from "../lib/supabase";

const {
      data: { user },
    } = await supabase.auth.getUser();
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

Supabase getUser() returns undefined
SupabaseSSupabase / help-and-questions
7mo ago
supabaseClient.auth.getUser returns null even if authenticated.
SupabaseSSupabase / help-and-questions
6mo ago
Next.js middleware with @supabase/ssr: auth.getUser() returns null even when auth cookie exists
SupabaseSSupabase / help-and-questions
4mo ago
Edge Function getUser user is always null
SupabaseSSupabase / help-and-questions
14mo ago