public User LoginUser(string email, string pword) { var user = userDb.GetUserByEmail(email); string hashedPass = crypto.HashPassword(pword, user.Salt); try { if (hashedPass == user.PWord) { return(userDb.LoginUser(email, hashedPass)); } } catch (Exception) { throw; } return(user); }