feat : Implement last las login feature
feat : add transaction password column and write logic for transaction password.
This commit is contained in:
@@ -5,7 +5,10 @@ const express = require('express');
|
||||
const router = express.Router();
|
||||
|
||||
router.post('/login', authController.login);
|
||||
router.get('/user_details', authenticate, authController.fetchUserDetails);
|
||||
router.get('/tpin', authenticate, authController.tpin);
|
||||
router.post('/tpin', authenticate, authController.setTpin);
|
||||
router.post('/login_password', authenticate, authController.setLoginPassword);
|
||||
router.post('/transaction_password', authenticate, authController.setTransactionPassword);
|
||||
|
||||
module.exports = router;
|
||||
|
@@ -2,10 +2,24 @@ const transferController = require('../controllers/transfer.controller');
|
||||
const { logger } = require('../util/logger');
|
||||
const express = require('express');
|
||||
const tpinValidator = require('../validators/tpin.validator');
|
||||
const tpasswordValidator = require('../validators/tpassword.validator');
|
||||
const transferValidator = require('../validators/transfer.validator');
|
||||
|
||||
const router = express.Router();
|
||||
router.use(tpinValidator, transferValidator);
|
||||
// Added for tpassword
|
||||
const passwordValidator=async(req,res,next)=>{
|
||||
const{tpin,tpassword} =req.body;
|
||||
if(tpin){
|
||||
return tpinValidator(req,res,next);
|
||||
}
|
||||
else if(tpassword){
|
||||
return tpasswordValidator(req,res,next);
|
||||
}
|
||||
else{
|
||||
return res.status(400).json({error:"tpin or tpassword is required"})
|
||||
}
|
||||
}
|
||||
router.use(passwordValidator, transferValidator);
|
||||
|
||||
const transferRoute = async (req, res) => {
|
||||
const { fromAccount, toAccount, toAccountType, amount } = req.body;
|
||||
|
Reference in New Issue
Block a user