Why am I getting "A data breach on a site or app exposed your password. Chrome recommends changing your password on "SITENAME" now."
14,469
The code appears okay. If you are using Google Chrome it has a feature that warns if the password you are using has been previously compromised. So, if you are testing with a common password this may occur. If this is production than you should update your password as the warning indicates.
Related videos on Youtube
Author by
saladWithRanch
Updated on July 06, 2022Comments
-
saladWithRanch almost 2 years
I created an app, that stores your password with bcrypt, and the input type of the form is password. I don't understand why I am receiving this alert? Why am I getting "A data breach on a site or app exposed your password. Chrome recommends changing your password on "SITENAME" now."
axios.post(`/signup`, { userBody: values.username, passwordBody: values.password }).then(response => console.log(response)) .then(response => history.push('/login')) .catch(error => { setErrors({ error: error.response.status }) }) } else { alert('cant be empty fields') } }
server.js
app.post('/signup', async (req, res) => {
const today = new Date(); const userData = { username: req.body.userBody, password: req.body.passwordBody, created: today }; User.findOne({ where: { username: req.body.userBody } }) .then(user => { if (!user) { bcrypt.hash(req.body.passwordBody, 10, (err, hash) => { userData.password = hash User.create(userData) .then(user => { res.json({ status: user.username + " registered" }) }) .catch(err => { res.send('error' + err) }) }) } else { res.status(500).json({ message: 'message' }) console.log('User exists') } }) .catch(err => { res.send('error' + err) })
})
-
Karimov over 3 yearsthank you i was using abc for pass testing, it freaking me out