Then your token expired, or you are not passing what you think you are passing to the headers. (Possibley that the token is blank/missing when calling the function)
You can use Authentication | Twitch Developers to validate a token.
Should being the operative word but might not be the case.
Also really shouldn’t be storing an “app access token” in localstorage since that doesn’t belong to the user using your site.