Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TokenError after logging in and accepting the Trovo permissions #2

Open
surudoiryu opened this issue May 30, 2021 · 3 comments
Open

Comments

@surudoiryu
Copy link

I have used the base example in the README and created the .env file with the variables i've got from the developers Trovo page.
When i spin up the application i get redirected correctly to Trovo login page, see all the permissions i need to agree on. But whenever i press "Allow" i get this error in the code in my console:

Express Started
TokenError
    at Strategy.OAuth2Strategy.parseErrorResponse (E:\TrovoBot\node_modules\passport-oauth2\lib\strategy.js:358:12)
    at Strategy.OAuth2Strategy._createOAuthError (E:\TrovoBot\node_modules\passport-oauth2\lib\strategy.js:405:16)
    at E:\TrovoBot\node_modules\passport-oauth2\lib\strategy.js:175:45
    at E:\TrovoBot\node_modules\oauth\lib\oauth2.js:191:18
    at passBackControl (E:\TrovoBot\node_modules\oauth\lib\oauth2.js:132:9)
    at IncomingMessage.<anonymous> (E:\TrovoBot\node_modules\oauth\lib\oauth2.js:157:7)
    at IncomingMessage.emit (events.js:322:22)
    at endReadableNT (_stream_readable.js:1187:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

The credentials are fine, i double checked them.
Could it be a dependency that has been updated ? These are the ones i have in my project:

"dependencies": {
    "async": "^3.2.0",
    "body-parser": "^1.19.0",
    "cors": "^2.8.5",
    "dotenv": "^10.0.0",
    "ejs": "^3.1.6",
    "express": "^4.17.1",
    "express-session": "^1.17.2",
    "helmet": "^4.6.0",
    "jsonwebtoken": "^8.5.1",
    "passport": "^0.4.1",
    "passport-oauth2-refresh": "^2.0.2",
    "passport-trovo.js": "0.0.1",
    "pg": "^8.6.0",
    "request": "^2.88.2"
  }

Thanks for helping,
With kind regards.

@phlare
Copy link

phlare commented Nov 17, 2021

I've got the same issue presently, thanks. @surudoiryu any word?

@surudoiryu
Copy link
Author

Yo @phlare ,
No unfortunately nothing of new knowledge with this project.
I made my bot works by using the Chat Socket at the end, but if there is a way to fix this problem I would still like to know it.

I didn't need my bot to send messages to the chat anyway, and only activate things like lights at home etc.
If you don't need to send chat messages too, I would suggest to do it the same way, or figure a way out to implement OAuth yourself, I simply didn't wanted to waste too much time on the things I needed my bot for. =)

P.s. Dez posted your new emoticons in my Discord Group, they look amazing! :D

@phlare
Copy link

phlare commented Nov 17, 2021

Yeah looks like the issue might be with the underlying passport-oauth2 package and not this one. Will see if I can fork both and find a path forward.

Was also trying to not implement the whole flow myself, but may end up having to. Spending the time fixing this instead of just building it myself benefits the community more though so I'll try that first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants