node-express-mongodb-jwt-rest-api-skeleton
Version:
Node.js express.js MongoDB JWT REST API - This is a basic API REST skeleton written on JavaScript using async/await. Great for building a starter web API for your front-end (Android, iOS, Vue, react, angular, or anything that can consume an API)
20 lines (18 loc) • 475 B
JavaScript
/**
* Builds an object with created forgot password object, if env is development or testing exposes the verification
* @param {Object} item - created forgot password object
*/
const forgotPasswordResponse = ({ email = '', verification = '' }) => {
let data = {
msg: 'RESET_EMAIL_SENT',
email
}
if (process.env.NODE_ENV !== 'production') {
data = {
...data,
verification
}
}
return data
}
module.exports = { forgotPasswordResponse }