Closed athulanilthomas closed 7 months ago
@fostertheweb can you please take a look into this ?
Only withAccessToken
is available on the server, which requires using the mixed auth pattern documented in the readme.
@fostertheweb In my scenario, there isn't a client, so I need the server to manage the entire authentication process, including redirection.
for example: In a scenario where I need to pass user-related information (user will remain constant) to the client, and the client should not need to know about Spotify authentication or other details, then there will be only one service (which is the server) right ?
This is a client library, so it does not serve that use case. If you don't want to start from scratch using the Spotify Web API, you could try using spotify-node-wrapper
@fostertheweb Thank you for the suggestion. However, currently, the Node.js wrapper only supports the client credentials model for authentication, which doesn't allow access to personal information. I've devised a workaround to make this SDK compatible with server-side operations by customizing the existing AuthenticateWithPKCE strategy.
For implementation details, please visit: Endpoint
Environment
Describe the bug
The problem arises when utilizing the SDK on a Node.js server environment, where access is restricted to web APIs and not the 'window' object. Consequently, when implementing a server API within Nuxt, the absence of a 'window' object renders certain functionalities ineffective. It appears that the
redirectOrVerifyToken
function was designed with client-side usage in mind. Hence, its inclusion within thewithUserAuthorization
method raises questions. In essence, the issue arises when attempting to use the SDK within a Node server environment.Additional context
None
Logs