Added CSRF protection to all API calls. /api/account AJAX calls updated.
This commit is contained in:
parent
7e0c8e72c5
commit
106b0fcddb
11 changed files with 149 additions and 14 deletions
|
|
@ -32,11 +32,14 @@ const channelManager = require('./app/channel/channelManager');
|
|||
//Util
|
||||
const configCheck = require('./utils/configCheck');
|
||||
const scheduler = require('./utils/scheduler');
|
||||
const {errorMiddleware} = require('./utils/loggerUtils');
|
||||
//DB Model
|
||||
const statModel = require('./schemas/statSchema');
|
||||
const flairModel = require('./schemas/flairSchema');
|
||||
const emoteModel = require('./schemas/emoteSchema');
|
||||
const tokeCommandModel = require('./schemas/tokebot/tokeCommandSchema');
|
||||
//Controller
|
||||
const fileNotFoundController = require('./controllers/404Controller');
|
||||
//Router
|
||||
//Humie-Friendly
|
||||
const indexRouter = require('./routers/indexRouter');
|
||||
|
|
@ -132,6 +135,14 @@ app.use('/lib/altcha',express.static(path.join(__dirname, '../node_modules/altch
|
|||
//Server public 'www' folder
|
||||
app.use(express.static(path.join(__dirname, '../www')));
|
||||
|
||||
//Handle error checking
|
||||
app.use(errorMiddleware);
|
||||
|
||||
//Basic 404 handler
|
||||
app.use(fileNotFoundController);
|
||||
|
||||
|
||||
|
||||
//Increment launch counter
|
||||
statModel.incrementLaunchCount();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue