React login advice wanted

So i am making a react project currently, and i have established connection to a MYSQL database with encryption. But i have no idea of how to make it possible to login afterwards.

app.post("/signup", (req, res) => {
const { email, firstname, lastname, password } = req.body;
const hashedPassword = encrypt(password);

db.query("INSERT INTO accounts (email, fName, lName, password, iv) VALUES (?, ?, ?, ?, ?)", [
    email,
    firstname,
    lastname,
    hashedPassword.password,
    hashedPassword.iv 
], (err, result)=>{
    if(err) {
        console.log(err);
    }
    else {
        console.log("Success!");
    }
}
);

}); This is where i store data inside the database.



Read more here: https://stackoverflow.com/questions/67382513/react-login-advice-wanted

Content Attribution

This content was originally published by Mellow Mellow at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: