Commit 4908fce048a7aac1bf80b4876587e7829695107c
1 parent
88e3e4b5
bugfix: materialisieren des Profils korrigiert
Showing
1 changed file
with
9 additions
and
3 deletions
src/main/java/net/ziemers/swxercise/lg/model/user/Profile.java
@@ -46,7 +46,7 @@ public class Profile extends BaseEntity { | @@ -46,7 +46,7 @@ public class Profile extends BaseEntity { | ||
46 | this(); | 46 | this(); |
47 | 47 | ||
48 | setUsername(username); | 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,13 +138,19 @@ public class Profile extends BaseEntity { | ||
138 | return passwordHash; | 138 | return passwordHash; |
139 | } | 139 | } |
140 | 140 | ||
141 | - private void setPasswordHash(String password) { | 141 | + private void setPassword(String password) { |
142 | // das Klartextkennwort wird niemals gespeichert! | 142 | // das Klartextkennwort wird niemals gespeichert! |
143 | this.passwordHash = cryptString(password); | 143 | this.passwordHash = cryptString(password); |
144 | } | 144 | } |
145 | 145 | ||
146 | + private void setPasswordHash(String passwordHash) { | ||
147 | + this.passwordHash = passwordHash; | ||
148 | + } | ||
149 | + | ||
146 | public boolean isValidPassword(final String password) { | 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 | @Enumerated(EnumType.STRING) | 156 | @Enumerated(EnumType.STRING) |