Skip to content

fix: populate user claims alongside session in SPA mode#594

Open
zlotnika wants to merge 2 commits intonuxt-modules:mainfrom
zlotnika:fix/populate-user-on-session-restore
Open

fix: populate user claims alongside session in SPA mode#594
zlotnika wants to merge 2 commits intonuxt-modules:mainfrom
zlotnika:fix/populate-user-on-session-restore

Conversation

@zlotnika
Copy link
Copy Markdown
Contributor

#571 added getSession() in SPA mode to restore the session before auth middleware runs. But this pre-sets currentSession before onAuthStateChange is registered, so when the SIGNED_IN event fires the handler skips it (session already matches) and getClaims() never runs — leaving useSupabaseUser() null on page load.

Fix: call getClaims() right after getSession() returns a session, same place currentSession is set.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 11, 2026

@zlotnika is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 14, 2026

npm i https://pkg.pr.new/@nuxtjs/supabase@594

commit: 435855d

@larbish
Copy link
Copy Markdown
Member

larbish commented Apr 14, 2026

Hey @zlotnika, thanks for the PR.

I don't get it, useSupabaseUser should be populate when page:start hook is triggered isn'it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants