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
Unlucky this did not resolve issue and I am getting following session error
[next-auth][error][SESSION_ERROR]
https://next-auth.js.org/errors#session_error Cannot read properties of undefined (reading 'steam') {
message: "Cannot read properties of undefined (reading 'steam')",
stack: "TypeError: Cannot read properties of undefined (reading 'steam')\n" +
' at Object.session (/REDACTED_PATHNAME/.next/server/chunks/ssr/[root of the server]__01193f._.js:389:38)\n' +
' at Object.session (/REDACTED_PATHNAME/.next/server/chunks/ssr/node_modules_next-auth_afab3f._.js:2236:56)\n' +
' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
' at async AuthHandler (/REDACTED_PATHNAME/.next/server/chunks/ssr/node_modules_next-auth_afab3f._.js:3370:37)\n' +
' at async getServerSession (/REDACTED_PATHNAME/.next/server/chunks/ssr/node_modules_next-auth_afab3f._.js:3753:21)\n' +
' at async Home (/REDACTED_PATHNAME/.next/server/chunks/ssr/[root of the server]__01193f._.js:669:21)',
name: 'TypeError'
}
[next-auth][error][SESSION_ERROR]
https://next-auth.js.org/errors#session_error Cannot read properties of undefined (reading 'steam') {
message: "Cannot read properties of undefined (reading 'steam')",
stack: "TypeError: Cannot read properties of undefined (reading 'steam')\n" +
' at Object.session (/REDACTED_PATHNAME/.next/server/chunks/ssr/[root of the server]__01193f._.js:389:38)\n' +
' at Object.session (/REDACTED_PATHNAME/.next/server/chunks/ssr/node_modules_next-auth_afab3f._.js:2236:56)\n' +
' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
' at async AuthHandler (/REDACTED_PATHNAME/.next/server/chunks/ssr/node_modules_next-auth_afab3f._.js:3370:37)\n' +
' at async getServerSession (/REDACTED_PATHNAME/.next/server/chunks/ssr/node_modules_next-auth_afab3f._.js:3753:21)\n' +
' at async Home (/REDACTED_PATHNAME/.next/server/chunks/ssr/[root of the server]__01193f._.js:669:21)',
name: 'TypeError'
}
Maybe someone who understands way better than me, could give some hints, what am I missing out on
4 replies
TTCTheo's Typesafe Cult
Created by yueweawa on 4/18/2024 in #questions
Getting next-auth-steam to work with create-t3-app
I did some changes that theoretically should fix the issue, 1. declared next-auth/jwt so it has steam property
declare module "next-auth/jwt" {
interface JWT extends DefaultJWT {
steam?: any; // temp: just to get it working
}
}
declare module "next-auth/jwt" {
interface JWT extends DefaultJWT {
steam?: any; // temp: just to get it working
}
}
2. minimally modified callbacks
jwt({ token, account, profile }) {
if (account?.provider === PROVIDER_ID) token.steam = profile;

return token;
},
session: ({ session, token }) => ({
...session,
user: {
...session.user,
steam: token.steam ? token.steam : null // yes, i added steam field to Session interface aswell
},
}),
jwt({ token, account, profile }) {
if (account?.provider === PROVIDER_ID) token.steam = profile;

return token;
},
session: ({ session, token }) => ({
...session,
user: {
...session.user,
steam: token.steam ? token.steam : null // yes, i added steam field to Session interface aswell
},
}),
4 replies
TTCTheo's Typesafe Cult
Created by Giuliopime on 4/16/2024 in #questions
Animating a background moving between grid elements
8 replies