Skip to content

Simple implementation of Discord OAuth2 authentication.

License

Notifications You must be signed in to change notification settings

ArturMiguel/discord-oauth2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord OAuth2

Implementation of Discord OAuth2 authentication in Node.js/Typescript to obtain authenticated user information.


Configuration and Installation

  1. Create an Discord application and define a name:

  1. Set the redirect URL and save changes:

  1. Clone this project to your computer:
git clone https://github.com/ArturMiguel/discord-oauth2
  1. Install the dependencies:
npm install
  1. Create an .env file with the CLIENT ID and CLIENT SECRET from your Discord application:
CLIENT_ID=
CLIENT_SECRET=


Running

  1. To run in development mode, type:
npm run dev
  1. Access http://localhost:3000/api/discord/auth

  1. Clicking in "Authorize", will return a json with the authenticated user's information:

About

Simple implementation of Discord OAuth2 authentication.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published