Social Login state mismatch error
I migrated to v 1.2 and this broke the apple and google logins for my site. I couldn't figure out what exactly was wrong as the oauth flow wasn't completing successfully. I got this logs in my server
this is the server error logs 2025-03-03T06:39:36: ^[[2m2025-03-03T06:39:36.790Z^[[0m ^[[31mERROR^[[0m ^[[1m[Better Auth]:^[[0m State Mismatch. Verification not found { stat>
2025-03-03T06:39:36: # SERVER_ERROR: TypeError: Cannot read properties of undefined (reading 'get')
2025-03-03T06:39:36: at <unknown> (.next/server/chunks/903.js:299:18339)
2025-03-03T06:39:36: at Object.r [as handler] (.next/server/chunks/903.js:84:105326)
2025-03-03T06:39:36: at async y (.next/server/chunks/903.js:84:93446)
2025-03-03T06:39:36: at async r.<computed> (.next/server/chunks/903.js:84:95322)
2025-03-03T06:39:36: at async n (.next/server/chunks/903.js:113:3325)
2025-03-03T06:39:36: at async handler (.next/server/chunks/903.js:113:3609)
2025-03-03T06:40:46: # SERVER_ERROR: TypeError: Cannot read properties of undefined (reading 'get')
2025-03-03T06:40:46: at <unknown> (.next/server/chunks/903.js:299:18339)
2025-03-03T06:40:46: at Object.r [as handler] (.next/server/chunks/903.js:84:105326)
2025-03-03T06:40:46: at async y (.next/server/chunks/903.js:84:93446)
2025-03-03T06:40:46: at async r.<computed> (.next/server/chunks/903.js:84:95322)
2025-03-03T06:40:46: at async n (.next/server/chunks/903.js:113:3325)
2025-03-03T06:40:46: at async handler (.next/server/chunks/903.js:113:3609)
. Reverting back to 1.1.21 fixed it and my oauth flow started working correctly again. Obviously, I need to upgrade so what is the cause of this and how can i fix it?4 Replies