ยฉ 2026 Hedgehog Software, LLC

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

Help with session - I can't get the refresh_token

I am trying to get the
refresh_token
refresh_token
from an already logged user using
supabaseClient.auth.session()
supabaseClient.auth.session()
when load the page but doesn't return that value.

This is the code
import { supabaseClient } from '@supabase/supabase-auth-helpers/nextjs';
import { useUser } from '@supabase/supabase-auth-helpers/react';

const Onboarding = () => {
  const { user } = useUser();
...
  useEffect(() => {
    if (user) {
      console.log('session: ', supabaseClient.auth.session());
...
}
import { supabaseClient } from '@supabase/supabase-auth-helpers/nextjs';
import { useUser } from '@supabase/supabase-auth-helpers/react';

const Onboarding = () => {
  const { user } = useUser();
...
  useEffect(() => {
    if (user) {
      console.log('session: ', supabaseClient.auth.session());
...
}


The value displayed is:
{
    "access_token": "user.jwt.tokenxxxx",
    "token_type": "bearer",
    "user": null
}
{
    "access_token": "user.jwt.tokenxxxx",
    "token_type": "bearer",
    "user": null
}


Why I can't access the refresh token?
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

How to refresh the session with no access to `refresh_token`?
SupabaseSSupabase / help-and-questions
3y ago
GoTrue can't persist provider refresh token
SupabaseSSupabase / help-and-questions
4y ago
Invalid Refresh Token: Refresh Token Not found
SupabaseSSupabase / help-and-questions
2y ago
refresh session error
SupabaseSSupabase / help-and-questions
4y ago