Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- router.post('/poster', async (req, res) => {
- var username = req.body.username.toString()
- var hashedpass = await hashPass(req.body.password)
- db.any("insert into users (email, username, password)\
- values($1, $2, $3)", ['yeeeseer', username, hashedpass])
- console.log(hashedpass)
- res.send('it worked, figure out error message later')
- });
- function hashPass(plainText){
- var saltRounds = 8;
- bcrypt.genSalt(saltRounds, async function(err, salt) {
- bcrypt.hash(plainText, salt, function(err, hash) {
- //return hash?
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement