Discord Oauth2 Example
The methods was taken from Dank Memer Rewrite Website but this code is simplified only for the oauth2 codes. The design is completlely different , just the methods.
.env
COOKIE_SECRET= COOKIE_SECRET
CLIENT_ID= DISCORD CLIENT ID
CLIENT_SECRET= DISCORD CLIENT SECRET
CRYPT_KEYS= Array of crypt keys [2]
DOMAIN=http://localhost:3000 // Or the website domain
MONGODB_URI= MONGODB URI
MONGODB_DB= MONGODB COLLECTION NAME < ANY NAME >
REDIS_PORT=6379
REDIS_HOST=localhost
- Generating
CRYPT_KEYS
=
node -p "[ 32, 16 ].map(n => crypto.randomBytes(n).toString('base64'))"
- Cookie Secret ( At leat 32 characters long. )
1password.com
Written By
Method Authors
- Ronin – Initial work – TheCyberRonin
- Mel – Initial design – Melmsie
- Aetheryx – Basically the whole thing – Aetheryx
- InBlue – Taken over work for redesign – InBlue
- Badosz – Rewrite and feedback page – badosz0