Skip to content

Instantly share code, notes, and snippets.

@orels1
Last active June 17, 2019 22:37
Show Gist options
  • Save orels1/c8cca2cfe9fb88b7d5736d3ecc31f1b9 to your computer and use it in GitHub Desktop.
Save orels1/c8cca2cfe9fb88b7d5736d3ecc31f1b9 to your computer and use it in GitHub Desktop.
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