v1.0
If you are working on your local machine, your host domain will usually either be localhost
or 127.0.0.1
If the address localhost
isn't working you, here is a brilliant Stackoverflow post to explain and teach you how to config one for yourself Stackoverflow Post
OS | File Location |
---|---|
Linux | /etc/hosts |
Windows | C:\Windows\System32\drivers\etc\hosts |
MacOS | /etc/hosts |
In order to allow Discord to give out user's login credential without the user themself actually providing any secrets to third parties, Discord and many other services are using what known as an "OAuth Protocol" to give third parties application or services to permissions on behalf of the user themself to access the host services resource, in this case, we are accessing user's public information and their communities servers
Your RedirectURI should look something like this: {HOST}:{?PORT}/authorize/callback
Examples:
For a typical local machine: http://localhost:3000/authorize/callback
For a Heroku pod: https://your-app-name.heroku.app/authorize/callback
- please navigate to the Discord Developer Web Console Link
- Click and open your testing bot It should look something like this
- Click on the "Oauth2" button on the side menu
- Click on the "Add Redirect" button
- And paste your redirect URI into the input box
- And once you have pasted the URI, just click "Save Changes"
- Navigate back to your code editor, and open the ".env" file
- Add a new variable named
DISCORD_REDIRECT_URI
and the value is your redirect URI
And you are pretty much done 🎉