Error while better-auth is attempting to renew? accessToken with Twitch
I understand that after the accessToken expires, better-auth automatically attempts to refresh the token in the background. For me at least, it fails to get a valid access token. Not sure how to track down what is happening but this image shows the error message(s) I get. I can initiate a sign in just fine and get another accesstoken but i'd rather have it renew the accesstoken like it should in the background.
I'm using Nuxt 4.0.3/nitro 2.12.4, better-auth 1.3.6.

1 Reply
sorry ya'll.. I had followed a tutorial/guide on a youtube channel and he changed the user id field to use int auto-increment. So the database not completely 'vanilla'. I wiped the db and migrations and regenerated the auth tables, migrated and now waiting on twitch accesstoken to expire to see if the issue still exists. Roughly 3 hours from now.
Ok, token expired and I'm still getting this error. I went from using node 24.x down to LTS 22.18.0, nuxt 4.0.3 down to 3.18.1. I tried using better-auth 1.3.7-beta.1 and down to 1.3.4/5? one of the two. I'm not sure what else to try.
alright, so i traced it down to possibly this. the api call to twitch succeeds. the refreshAccessToken function gets the data, but twitch returns an array for "scope". The current code tries to split that "array" and gets the error we see above.