'Invalid OAuth2 redirect_uri

Im making a dashboard for my discord bot on replit with Node.Js but when I click "add to discord/add to server" it says "Invalid OAuth2 redirect_uri" how can I fix this?



Solution 1:[1]

Kind reminder, when asking questions make sure to provide the most amount of details to further assists others in assisting you.

The error derives from the redirect_uri parameter in your oauth2 link not matching with those in the developer portal.

In your developer portal go to OAuth2 -> General -> Redirects
Make sure you have one created.
Then go to the URL Generator, select your scopes, and then in the option where it says SELECT REDIRECT URL set that to the url you just created/selected.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Finbar