Replies: 2 comments
-
Hey @xTunqki did you figure this out? I'm having a hard time getting callbacks: {
async signIn({ user, profile }) {
user.username = profile.screen_name
console.log('inside signin')
console.log({ user, profile })
return true
},
async session({ session, token }) {
session.user = token.user
// i also tried `session.username = user.username`
console.log('inside session')
console.log({ session, token })
return session
},
async jwt({ token, account, profile, user }) {
if (account) {
token[account.provider] = {
oauth_token: account.oauth_token,
oauth_token_secret: account.oauth_token_secret,
}
}
console.log('inside jwt')
console.log({ token, profile })
return token
},
}, But nothing works. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Found a solution on here that works (should be in docs): callbacks: {
async session({ session, token }) {
session.user = token.user
return session
},
async jwt({ token, account, user }) {
if (user) token.user = user
if (account) {
token[account.provider] = {
oauth_token: account.oauth_token,
oauth_token_secret: account.oauth_token_secret,
}
}
return token
},
}, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Question 💬
So I want to add aditional properties to session but it seems on session callback it doesnt have "profile" arguments on it so i guess ill export it from SignIn callback, here the code
How to reproduce ☕️
This what i got on Signin callback
but here the username property is gone on session callback
Contributing 🙌🏽
No, I am afraid I cannot help regarding this
Beta Was this translation helpful? Give feedback.
All reactions