code cleanup

This commit is contained in:
Hannes Huber 2020-05-25 10:21:36 +02:00
parent 60699ed847
commit 614a929592
3 changed files with 20 additions and 29 deletions

View File

@ -1,10 +1,7 @@
package org.hso.ecommerce.action.user;
import com.sun.xml.bind.v2.TODO;
import org.hibernate.sql.Update;
import org.hso.ecommerce.entities.user.User;
import org.hso.ecommerce.repos.user.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
public class UpdateUserSettingsAction {
@ -30,8 +27,7 @@ public class UpdateUserSettingsAction {
public UpdateResult updatePassword(String oldPassword, String password1, String password2) {
UpdateResult result = new UpdateResult(false);
if(this.user.validatePassword(oldPassword))
{
if (this.user.validatePassword(oldPassword)) {
if (password1.equals(password2)) {
if (!password1.equals(oldPassword)) {
this.user.setPassword(password1);

View File

@ -44,10 +44,6 @@ public class User {
return id;
}
public void setEmail(String email) {
this.email = email;
}
public boolean validatePassword(String password) {
return BCrypt.checkpw(password, passwordHash);
}

View File

@ -14,4 +14,3 @@ public interface CustomerOrderRepository extends JpaRepository<CustomerOrder, Lo
List<CustomerOrder> getOrdersByUserId(long userId);
}