markjaquith / clerk-sveltekit

Clerk adapter for SvelteKit
Other
128 stars 19 forks source link

How to get session information? #47

Open alka7ex opened 5 months ago

alka7ex commented 5 months ago

Hi guys.

I'm new here and just started using sveltekit with combination of clerk, amazing library it's make me easy to use clerk and it's almost done, however i got some challenges in my project.

sorry if the questions is a newbie questions how i can access the session and claims information?, i have setup it in my clerk app, but i keep got nothing image

i also get some issues where in my terminal i get error where the cookies is there but the token is not active

image

danielgraziani91 commented 2 months ago

Hi! I had to add prop into the app.d.ts file. image To access everything right away just assign session to object.

hbcondo commented 1 month ago

My session only returns an abbreviated user object as depicted below but the readme says it will get a Clerk user object which contains a lot more properties such as organizationMembers + permissions. Anyone know how to get all these clerk user property values?

  session: {
    userId: 'user_123',
    claims: {
      azp: 'http://localhost',
      exp: 1716510495,
      iat: 1716510435,
      iss: 'https://grown-pug.clerk.accounts.dev',
      nbf: 1716510425,
      sid: 'sess_123',
      sub: 'user_123'
    }
  }
MariDjor commented 1 month ago

same here

dizeeee commented 4 weeks ago

The readme is definitely not right from what I can tell. The server only validates the token, then includes the token info in locals. The backend doesn't seem to be creating a Clerk client, which seems like a requirement to get any user info.