This commit is contained in:
Troplo 2020-10-24 01:16:40 +11:00
parent ac5e7738e5
commit e93a44dcd2
4 changed files with 5 additions and 5 deletions

View File

@ -1,4 +1,4 @@
module.exports = {
port: process.env.PORT || 23981,
sessionSecret: process.env.SESSION_SECRET || 'eokdhiuwesryuw7r78474eyrhygeryueyiue4784yuruwyruseyudhaijiauiziuhiuhr874r8yurrufdgiidsodajdlmdfr5af'
}
sessionSecret: process.env.SESSION_SECRET || 'iouydhtrfguyrthgftryhgidrhytgidhytiglriltnhgrhtiuygrthiugritghiyutrcginhrtijghurfcuhjgnioergjfuiehtiehtiehyritheithreifbhgehfbdxhbkvfdbhjkvgdkhnjUIYIRUiuiuYIYI3i42yiuyIUYIU4yiu$YUI#YUI$3mvsazr57;'
}

View File

@ -6,7 +6,7 @@ const Errors = require('../lib/errors')
module.exports = async(req, res, next) => {
try {
const token = req.headers.authorization.replace("Bearer ", "");
const decoded = jwt.verify(token, "asdasddadasdasdad3eqewa");
const decoded = jwt.verify(token, "iouydhtrfguyrthgftryhgidrhytgidhytiglriltnhgrhtiuygrthiugritghiyutrcginhrtijghurfcuhjgnioergjfuiehtiehtiehyritheithreifbhgehfbdxhbkvfdbhjkvgdkhnjUIYIRUiuiuYIYI3i42yiuyIUYIU4yiu$YUI#YUI$3mvsazr57;" + process.env.SESSION_SECRET);
req.userData = decoded;
let user = await User.findOne({ where: {
id: req.userData.UserId

View File

@ -5,7 +5,7 @@ const jwt = require("jsonwebtoken");
module.exports = async(req, res, next) => {
try {
const token = req.headers.authorization.replace("Bearer ", "");
const decoded = jwt.verify(token, "asdasddadasdasdad3eqewa");
const decoded = jwt.verify(token, "iouydhtrfguyrthgftryhgidrhytgidhytiglriltnhgrhtiuygrthiugritghiyutrcginhrtijghurfcuhjgnioergjfuiehtiehtiehyritheithreifbhgehfbdxhbkvfdbhjkvgdkhnjUIYIRUiuiuYIYI3i42yiuyIUYIU4yiu$YUI#YUI$3mvsazr57;" + process.env.SESSION_SECRET);
req.userData = decoded;
let user = await User.findOne({ where: {
id: req.userData.UserId

View File

@ -211,7 +211,7 @@ router.post('/login', async(req, res, next) => {
if(await user.comparePassword(req.body.password)) {
await Ip.createIfNotExists(req.ip, user)
const accessToken = jwt.sign({ username: user.username, admin: user.admin, executive: user.executive, email: user.email, UserId: user.id, loggedIn: true, bot: user.bot, offset: user.jwtOffset }, "asdasddadasdasdad3eqewa");
const accessToken = jwt.sign({ username: user.username, admin: user.admin, executive: user.executive, email: user.email, UserId: user.id, loggedIn: true, bot: user.bot, offset: user.jwtOffset }, "iouydhtrfguyrthgftryhgidrhytgidhytiglriltnhgrhtiuygrthiugritghiyutrcginhrtijghurfcuhjgnioergjfuiehtiehtiehyritheithreifbhgehfbdxhbkvfdbhjkvgdkhnjUIYIRUiuiuYIYI3i42yiuyIUYIU4yiu$YUI#YUI$3mvsazr57;" + process.env.SESSION_SECRET);
res.json({
accessToken