My api code:
exports.signUp = function (req, res) {
var newadmin = {
username: req.body.username,
firstname: req.body.firstname,
userKey: // i need random unique key here
password: encrypt(req.body.password)
}
Admin.create(newadmin).then(function (user) {
return res.status(200).send(user);
});
}
In my api i have userKey: column in this i want to insert some random unique key.
Aucun commentaire:
Enregistrer un commentaire