mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-24 06:03:28 -05:00
committed by
GitHub
parent
335044fece
commit
9b6042e44d
@@ -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) =>
|
||||
|
||||
Reference in New Issue
Block a user