Commit 4908fce048a7aac1bf80b4876587e7829695107c

Authored by Thomas Ziemer
1 parent 88e3e4b5

bugfix: materialisieren des Profils korrigiert

src/main/java/net/ziemers/swxercise/lg/model/user/Profile.java
... ... @@ -46,7 +46,7 @@ public class Profile extends BaseEntity {
46 46 this();
47 47  
48 48 setUsername(username);
49   - setPasswordHash(password);
  49 + setPassword(password);
50 50 }
51 51  
52 52 /*
... ... @@ -138,13 +138,19 @@ public class Profile extends BaseEntity {
138 138 return passwordHash;
139 139 }
140 140  
141   - private void setPasswordHash(String password) {
  141 + private void setPassword(String password) {
142 142 // das Klartextkennwort wird niemals gespeichert!
143 143 this.passwordHash = cryptString(password);
144 144 }
145 145  
  146 + private void setPasswordHash(String passwordHash) {
  147 + this.passwordHash = passwordHash;
  148 + }
  149 +
146 150 public boolean isValidPassword(final String password) {
147   - return getPasswordHash().equals(cryptString(password));
  151 + final String passwordHash = cryptString(password);
  152 +
  153 + return getPasswordHash().equals(passwordHash);
148 154 }
149 155  
150 156 @Enumerated(EnumType.STRING)
... ...