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(hashPass){
- var saltRounds = 8;
- bcrypt.genSalt(saltRounds, async function(err, salt) {
- return await bcrypt.hash(hashPass, salt,
- function(err, hash) {
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement