kevin
DIAdiscord.js - Imagine an app
•Created by kevin on 5/24/2024 in #djs-questions
Invalid_Grant error for OAuth 2.0
Goal for me was to initiate a redirect (in the server side) on my web app after I receive user information from discord authentication then use that information to populate the specified page that was being redirected to. Problem is I am getting an invalid_grant error with an error description of invalid "code" in my GET request. I made sure the redirect URIs were matching throughout; made sure there werent any other request calls being made at the same time; I am currently using express as my server and using express session to store my state and userinfo and axios to do my HTTP requests. I am also getting the user_info, the problem happens when it does a redirect on the server side. I am just lost in figuring out how to better diagnose this; any advice is really helpful. Does "invalid code" refer to the code used to exchange for the access token?
8 replies