mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 13:24:24 +00:00
stripe integration done, handling missing still
This commit is contained in:
@@ -12,6 +12,8 @@ const geth = require( './api/getHandler.js' );
|
||||
const postHandler = new posth();
|
||||
const getHandler = new geth();
|
||||
const path = require( 'path' );
|
||||
const bodyParser = require( 'body-parser' );
|
||||
|
||||
|
||||
// settings is missing in arguments which shouldn't pose any problem
|
||||
module.exports = ( app ) => {
|
||||
@@ -29,7 +31,7 @@ module.exports = ( app ) => {
|
||||
}
|
||||
} );
|
||||
|
||||
app.post( '/admin/API/:call', ( req, res ) => {
|
||||
app.post( '/admin/API/:call', bodyParser.json(), ( req, res ) => {
|
||||
if ( req.session.loggedInAdmin ) {
|
||||
postHandler.handleCall( req.params.call, req.body, req.query.lang ).then( data => {
|
||||
res.send( data );
|
||||
|
||||
@@ -14,6 +14,7 @@ const twoFA = new auth();
|
||||
const path = require( 'path' );
|
||||
const mail = require( '../backend/mail/mailSender.js' );
|
||||
const mailManager = new mail();
|
||||
const bodyParser = require( 'body-parser' );
|
||||
|
||||
let responseObjects = {};
|
||||
let authOk = {};
|
||||
@@ -23,7 +24,7 @@ module.exports = ( app, settings ) => {
|
||||
Admin login route that checks the password
|
||||
*/
|
||||
|
||||
app.post( '/admin/auth', ( request, response ) => {
|
||||
app.post( '/admin/auth', bodyParser.json(), ( request, response ) => {
|
||||
if ( request.body.mail && request.body.password ) {
|
||||
pwdmanager.checkpassword( request.body.mail, request.body.password ).then( data => {
|
||||
request.session.username = request.body.mail;
|
||||
@@ -75,7 +76,7 @@ module.exports = ( app, settings ) => {
|
||||
}
|
||||
} );
|
||||
|
||||
app.post( '/admin/2fa/verify', ( request, response ) => {
|
||||
app.post( '/admin/2fa/verify', bodyParser.json(), ( request, response ) => {
|
||||
let verified = twoFA.verifyEnhanced( request.body.token, request.body.code );
|
||||
if ( verified ) {
|
||||
request.session.loggedInAdmin = true;
|
||||
|
||||
Reference in New Issue
Block a user