Added auth middleware to dataeditor, bg color change on some places

This commit is contained in:
MrFry 2020-04-08 18:09:56 +02:00
parent b970b2eb30
commit 143894288a
3 changed files with 36 additions and 17 deletions

View file

@ -25,21 +25,11 @@ const app = express()
const utils = require('../../utils/utils.js')
const logger = require('../../utils/logger.js')
const auth = require('../../middlewares/auth.middleware.js')
let userDB
function GetApp () {
app.set('view engine', 'ejs')
app.set('views', [
'./modules/dataEditor/views',
'./sharedViews'
])
app.use(express.static('modules/dataEditor/public'))
app.use(express.static('public'))
app.use(busboy({
limits: {
fileSize: 10000 * 1024 * 1024
}
}))
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({
limit: '5mb',
extended: true
@ -47,6 +37,26 @@ function GetApp () {
app.use(bodyParser.json({
limit: '5mb'
}))
app.set('view engine', 'ejs')
app.set('views', [
'./modules/dataEditor/views',
'./sharedViews'
])
app.use(auth({
userDB: userDB,
jsonResponse: false,
exceptions: [
'/favicon.ico',
'/getVeteranPw'
]
}))
app.use(express.static('modules/dataEditor/public'))
app.use(express.static('public'))
app.use(busboy({
limits: {
fileSize: 10000 * 1024 * 1024
}
}))
// --------------------------------------------------------------
@ -91,3 +101,6 @@ function GetApp () {
exports.name = 'Data editor'
exports.getApp = GetApp
exports.setup = (data) => {
userDB = data.userDB
}

View file

@ -1,6 +1,6 @@
<html>
<body bgcolor="#212127">
<body bgcolor="#222426">
<head>
<title>Frylabs</title>
<meta charset="UTF-8">
@ -40,11 +40,14 @@
cursor: pointer;
}
input[type=text], input[type=password] {
font-size: 20px;
color: #ffffff;
background-color: #181a1b;
width: 100%;
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
border: 2px solid #fff;
border: 2px solid #333333;
text-align: center;
}
input[type=text], input[type=password]:focus {

View file

@ -1,5 +1,5 @@
<html>
<body bgcolor="#212127">
<body bgcolor="#222426">
<head>
<title>Frylabs</title>
<meta charset="UTF-8">
@ -40,11 +40,14 @@
cursor: pointer;
}
input[type=text], input[type=password] {
font-size: 20px;
color: #ffffff;
background-color: #181a1b;
width: 100%;
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
border: 2px solid #fff;
border: 2px solid #333333;
text-align: center;
}
input[type=text], input[type=password]:focus {