Skip to content

useSession Hook isn't returning accessToken #1328

Discussion options

You must be logged in to vote

It does not do that by default.

See the TIP section right under the link you posted:

The session data returned to the client does not contain sensitive information such as the Session Token or OAuth tokens. It contains a minimal payload that includes enough data needed to display information on a page about the user who is signed in for presentation purposes (e.g name, email, image). You can use the session callback to customize the session object returned to the client if you need to return additional data in the session object.

access_token goes under OAuth token.

Check out the jwt and session callbacks:
https://next-auth.js.org/configuration/callbacks#jwt-callback
https://next-auth.j…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@harshithpabbati
Comment options

@balazsorban44
Comment options

@harshithpabbati
Comment options

@balazsorban44
Comment options

Answer selected by balazsorban44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1327 on February 17, 2021 18:02.