feat: enable mobile auth endpoints (#49298

Reverts #49212
This commit is contained in:
Mrugesh Mohapatra
2023-02-09 14:01:13 +05:30
committed by GitHub
parent 335044fece
commit 9b6042e44d
8 changed files with 184 additions and 5 deletions

View File

@@ -77,6 +77,20 @@ export function ifUserRedirectTo(status) {
};
}
export function ifNotMobileRedirect() {
return (req, res, next) => {
//
// Todo: Use the below check once we have done more research on usage
//
// const isMobile = /(iPhone|iPad|Android)/.test(req.headers['user-agent']);
// if (!isMobile) {
// res.json({ error: 'not from mobile' });
// } else {
// next();
// }
next();
};
}
// for use with express-validator error formatter
export const createValidatorErrorHandler =
(...args) =>