I have an application with nextjs where I identify the user with nextj auth so I can manage the youtube playlist, everything was working normally, until I add a new request and now when I deploy and a few hours pass, the application stops working and the error that google brings me is
"Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential"
The new request I added was that for each playlist that the user had, I would make a call to each of those playlists to bring me the videos they have and save them in the redux
Before I added this new request on line 38, this error did not happen
Actions.js Action
pages\api\YoutubeApi\getYTData.js Request to bring the playlists
pages\api\YoutubeApi\getVideosFromPlaylists.js pt 1 Request to bring the videos
pages\api\YoutubeApi\getVideosFromPlaylists.js pt 2 Request to bring the videos
pages\api\YoutubeApi\getVideosFromPlaylists.js pt 3 Request to bring the videos