修改两步验证逻辑

This commit is contained in:
hanhh
2021-09-03 19:09:09 +08:00
parent 035c69898f
commit ab4f167bda
3 changed files with 38 additions and 23 deletions
+3 -1
View File
@@ -151,13 +151,15 @@ export default (app: Router) => {
celebrate({
body: Joi.object({
code: Joi.string().required(),
username: Joi.string().required(),
password: Joi.string().required(),
}),
}),
async (req: Request, res: Response, next: NextFunction) => {
const logger: Logger = Container.get('logger');
try {
const authService = Container.get(AuthService);
const data = await authService.twoFactorLogin(req.body);
const data = await authService.twoFactorLogin(req.body, req);
res.send(data);
} catch (e) {
logger.error('🔥 error: %o', e);