Finish MFA v1 and refactor all tokens into separate TokenService with modified collection

This commit is contained in:
Tuan Dang
2023-01-23 22:10:15 +07:00
parent 00fee63ff3
commit 5cadb9e2f9
25 changed files with 692 additions and 98 deletions
+35
View File
@@ -0,0 +1,35 @@
import express from 'express';
const router = express.Router();
import { body } from 'express-validator';
import { validateRequest } from '../../middleware';
import { authController } from '../../controllers/v2';
import { authLimiter } from '../../helpers/rateLimiter';
router.post(
'/login1',
authLimiter,
body('email').exists().trim().notEmpty(),
body('clientPublicKey').exists().trim().notEmpty(),
validateRequest,
authController.login1
);
router.post(
'/login2',
authLimiter,
body('email').exists().trim().notEmpty(),
body('clientProof').exists().trim().notEmpty(),
validateRequest,
authController.login2
);
router.post(
'/mfa',
authLimiter,
body('email').exists().trim().notEmpty(),
body('mfaToken').exists().trim().notEmpty(),
validateRequest,
authController.verifyMfaToken
);
export default router;