achievements-app / psn-api

A JavaScript library that lets you get trophy, user, and game data from the PlayStation Network.
https://psn-api.achievements.app
MIT License
265 stars 33 forks source link

Unable to use it in Vue 3 #53

Closed Lyliya closed 1 year ago

Lyliya commented 2 years ago

Hello, i'm not able to transform my npsso into a code using this library in a VueJS project. The cookie is not send by default, i had to rebuild the library including credentials: 'include' in the fetch request (exchangeNpssoForCode.ts L30) But even with that, the script does not get the token from the Location header, even if its set

image

wescopeland commented 1 year ago

Hi @Lyliya ! Sorry for my ultra late reply 💀

This is caused by PSN throwing a CORS error (and the browser respecting that error). The issue can be bypassed if psn-api is run server-side. I am tracking an issue to detect CORS errors and have better messaging about them here: https://github.com/achievements-app/psn-api/issues/109