yueweawa
yueweawa
TTCTheo's Typesafe Cult
Created by yueweawa on 4/18/2024 in #questions
Getting next-auth-steam to work with create-t3-app
According to next-auth-steam's examples i should override jwt() and session() callbacks like this
jwt({ token, account, profile }) {
if (account?.provider === PROVIDER_ID) {
token.steam = profile
}
return token
},
session({ session, token }) {
if ('steam' in token) {
// @ts-expect-error
session.user.steam = token.steam
}
return session
}
jwt({ token, account, profile }) {
if (account?.provider === PROVIDER_ID) {
token.steam = profile
}
return token
},
session({ session, token }) {
if ('steam' in token) {
// @ts-expect-error
session.user.steam = token.steam
}
return session
}
https://github.com/Nekonyx/next-auth-steam/blob/master/examples/app-router-get-server-session/app/auth.ts#L17C7-L29C8 so I can access steam user data in session, i assume ? However this does not work in create-t3-app ( or maybe I am just missing out on something )
4 replies