Last active
June 17, 2019 22:37
-
-
Save orels1/c8cca2cfe9fb88b7d5736d3ecc31f1b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const router = express.Router(); | |
const CLIENT_ID = process.env.CLIENT_ID; | |
const CLIENT_SECRET = process.env.CLIENT_SECRET; | |
const redirect = encodeURIComponent('http://localhost:50451/api/discord/callback'); | |
router.get('/login', (req, res) => { | |
res.redirect(`https://discordapp.com/api/oauth2/authorize?client_id=${CLIENT_ID}&scope=identify&response_type=code&redirect_uri=${redirect}`); | |
}); | |
module.exports = router; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment