client credentials not refreshing token
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Device
Operating System
Mac
My Question or Issue
I am attempting to use the web-api-ts-sdk inside a Nextjs server action. I am using the withClientCredentials(), which I would assume I would not need to refresh the access token. But I get the following error when trying to use the client, after successfully creating the client:
"Bad or expired token. This can happen if the user revoked a token or the access token has expired. You should re-authenticate the user."
I am just trying to search something with the api, so not accessing user data.
export const createClient = async () => {
const cl = SpotifyApi.withClientCredentials(
process.env.SPOTIFY_CLIENT_ID ?? "",
process.env.SPOTIFY_CLIENT_SECRET ?? "");
return cl;
}
Labels:
- Labels:
-
Possible Bug
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page