Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports = async (req,res) =>{
- const User = req.app.locals.User;
- const user =User.build({
- email: req.body.email,
- displayName: req.body.display_name,
- realName: req.body.real_name,
- hashedPassword:req.body.password ,
- role: 0
- });
- try{
- await user.save();
- res.send({message:"Usuario creado exitosamente.", success:true });
- }
- catch(ex)
- {
- res.send({message:"Información es inválida:", success:false});
- }
- res.end();
Add Comment
Please, Sign In to add comment