A while ago I started developing a hobby web app and I created a NodeJS script (that uses the npm package jsonwebtoken) to generate my dev JWT and I used MusicKit in my web app with that generated dev JWT and also used Apple Music API and everything was working perfectly fine, and now I came back and wanted to continue the project from where I left off and I tried using the same code (I literally ran the same NodeJS file without changing anything, it already had the p8 file and the team ID and app key etc..) so I generated a new JWT with that script, and for the Apple Music API it's working as it should, but for some reason I can't use the JWT with the MusicKit for web... when I try to authorize the user it does open the authorization pop up window and after the user enters their Apple Music credentials and tries to login the pop up windows says there's an error and in the URL I can see an "error" query param with the value "ERROR_FAILED_TO_VERIFY_JWT"
IDK why this happens but I'm sure it's a bug, we should report it through the feedback app, but with my past experience with Apple Music API and MusicKit it is really buggy and cannot be relied for production just yet, also when submitting a ticket though the feedback app sometimes they reply within a day and other times I waited for almost a month with no response...