Discord OAuth2 Fetching user Information from Code IN URL

I am Wanting to make Sign in System for A form i am Making Where you Must Sign into Discord in order to use it However i don’t know how to use Discord’s OAuth2.

I have tired Searching it BUT DISCORD.js FLOODED THE RESULTS and Discord docs are NOT Clear.

(i am Talking about this https://a-Website.com/?code=CODE_HERE ) How do i fetch a Users Profile Picture and User using it and save it to a variable to be used in code?

Your Help is Much appreciated

if you need me to clarify please ask

Easiest way I know is using passport.js. You can set the scopes so that it gets the user info, email, profile picture, etc.

1 Like

This tutorial looks OK: https://medium.com/@orels1/using-discord-oauth2-a-simple-guide-and-an-example-nodejs-app-71a9e032770

1 Like