Error when account does not exist

pull/4/head
Jose Vera 2022-03-02 22:27:01 -05:00
parent 5835f6df44
commit be79a029fe
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@ async function readJWT(token) {
async function signIn(email, password) {
let account = await orm.models.accounts.findOne({ where: { email } });
if (account.dataValues) {
if (account && account.dataValues) {
account = account.dataValues;
const inputPassword = crypto.createHash('sha256').update(password + process.env.APP_SALT).digest('hex');
if (account.password === inputPassword) {