mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 21:34:24 +00:00
add more mysql stuff
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
|
||||
const db = require( './db/db.js' );
|
||||
const pwdmanager = require( './credentials/pwdmanager.js' );
|
||||
const auth = require( './credentials/2fa.js' );
|
||||
const twoFA = new auth();
|
||||
|
||||
module.exports = ( app, settings ) => {
|
||||
app.post( '/api/reserveTicket', ( request, response ) => {
|
||||
@@ -20,9 +22,12 @@ module.exports = ( app, settings ) => {
|
||||
if ( request.body.mail && request.body.password ) {
|
||||
pwdmanager.checkpassword( request.body.mail, request.body.password ).then( data => {
|
||||
if ( data ) {
|
||||
if ( settings.twoFA ) {
|
||||
if ( settings.twoFA === 'standard' ) {
|
||||
// TODO: Support both methods of 2fa
|
||||
response.send( '2fa' );
|
||||
} else if ( settings.twoFA === 'enhanced' ) {
|
||||
// TODO: Support both methods of 2fa
|
||||
response.send( '2fa+' );
|
||||
} else {
|
||||
request.session.loggedInUser = true;
|
||||
response.send( 'ok' );
|
||||
@@ -35,4 +40,8 @@ module.exports = ( app, settings ) => {
|
||||
response.send( 'missingCredentials' );
|
||||
}
|
||||
} );
|
||||
|
||||
app.get( '/user/2fa', ( request, response ) => {
|
||||
|
||||
} );
|
||||
};
|
||||
Reference in New Issue
Block a user