This file contains hidden or 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
router.get('/callback', catchAsync(async (req, res) => { | |
if (!req.query.code) throw new Error('NoCodeProvided'); | |
const code = req.query.code; | |
const creds = btoa(`${CLIENT_ID}:${CLIENT_SECRET}`); | |
const response = await fetch(`https://discordapp.com/api/oauth2/token?grant_type=authorization_code&code=${code}&redirect_uri=${redirect}`, | |
{ | |
method: 'POST', | |
headers: { | |
Authorization: `Basic ${creds}`, | |
}, |
This file contains hidden or 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 fetch = require('node-fetch'); | |
const btoa = require('btoa'); | |
const { catchAsync } = require('../utils'); |
This file contains hidden or 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
<!Doctype html> | |
<html> | |
<head> | |
<title>Discord Token Generator</title> | |
<style> | |
.container { | |
display: flex; | |
width: 100%; | |
padding: 40px 0; | |
align-items: center; |
This file contains hidden or 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
// Routes | |
app.use('/api/discord', require('./api/discord')); |
This file contains hidden or 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
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}`); | |
}); |
This file contains hidden or 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 CLIENT_ID = process.env.CLIENT_ID; | |
const CLIENT_SECRET = process.env.CLIENT_SECRET; | |
const redirect = encodeURIComponent('http://localhost:50451/api/discord/callback'); |
This file contains hidden or 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}`); |
This file contains hidden or 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 path = require('path'); | |
const app = express(); | |
app.get('/', (req, res) => { | |
res.status(200).sendFile(path.join(__dirname, 'index.html')); | |
}); | |
app.listen(50451, () => { |
This file contains hidden or 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
tracer kanobu.ru source 87.229.246.113 | |
Thu Apr 20 15:50:15.032 MSK | |
Type escape sequence to abort. | |
Tracing the route to 137.74.93.62 | |
1 p1.Barnaul.gldn.net (79.104.247.225) [MPLS: Label 651004 Exp 0] 72 msec | |
p2.Barnaul.gldn.net (79.104.247.229) 61 msec 62 msec | |
2 p1.Nsk.gldn.net (79.104.230.85) [MPLS: Labels 541326/648672 Exp 0] 70 msec | |
p2.Nsk.gldn.net (79.104.231.85) 75 msec |
This file contains hidden or 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
traceroute to 87.229.246.114 (87.229.246.114), 30 hops max, 60 byte packets | |
1 137.74.93.253 (137.74.93.253) 3.397 ms 28.979 ms 29.138 ms | |
2 po110.gra-g1-a75.fr.eu (37.187.231.91) 0.192 ms 0.236 ms po110.gra-g2-a75.fr.eu (37.187.231.93) 0.170 ms | |
3 10.95.33.10 (10.95.33.10) 2.048 ms 10.95.33.8 (10.95.33.8) 1.719 ms * | |
4 * * * | |
5 * * * | |
6 * * * |