forked from kaverti/website
prod
This commit is contained in:
parent
ac5e7738e5
commit
e93a44dcd2
|
@ -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;'
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue