Nekonyx / next-auth-steam

Steam authentication provider for next-auth
70 stars 18 forks source link

Retrieving SteamID from session #3

Closed bryanzack closed 1 year ago

bryanzack commented 1 year ago

Hi there, first of all I want to thank you for this library as I have been toying around with Next-Auth Steam authentication for months now searching for a solution, and I apologize that this isn't a real issue but there was no discussion tab to post in! I wanted to ask if you could shed some light how I would go about retrieving a steamid64 from a session. I have tried to implement the callback solution you have included at the bottom of read.md but I feel a lot goes over my head. As of now when I try accessing the session via getServerSession(), the object has name, email, and image in it. Would you be able to point me in the right direction?

bryanzack commented 1 year ago

Just adding some more context here. I am pretty sure I am misunderstanding something fundamental as to how a session is retrieved and/or accessed. In my route.ts I am successfully able to print out the information I desire with the following console.log(): webstorm64_ldKmYcYae5

So the desired information is being placed into the returned session, which tells me I am misunderstanding how to update/retrieve this session on the front-end. How should I be accessing the session?

Nekonyx commented 1 year ago

Hey, thank you for your interest in my work.

I updated module (version 0.1.4 is now on npm) and published a new example with getServerSession(): https://github.com/Nekonyx/next-auth-steam/tree/master/examples/get-server-session

I hope this helps you figure it out.

bryanzack commented 1 year ago

Got it working! Made PR. Thanks for the help.