Skip to content

Commit 1acff32

Browse files
committed
work in progres
1 parent 5b7c680 commit 1acff32

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

src/main/java/org/woehlke/simpleworklist/common/AbstractController.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,15 @@ public final List<TaskState> getTaskStates(){
118118
@ModelAttribute("context")
119119
public final String getCurrentContext(
120120
@ModelAttribute("userSession") UserSessionBean userSession,
121-
@ModelAttribute("userSession") Locale locale
121+
Locale locale
122122
){
123123
if(userSession == null){
124124
userSession = new UserSessionBean();
125125
}
126+
Context context = getContext(userSession);
126127
if(locale == null){
127128
locale = Locale.ENGLISH;
128129
}
129-
Context context = getContext(userSession);
130130
if(locale == GERMAN){
131131
return context.getNameDe();
132132
} else {
@@ -145,8 +145,12 @@ protected UserAccount getUser() {
145145

146146
protected Context getContext(UserSessionBean userSession){
147147
UserAccount thisUser = this.getUser();
148-
long defaultContextId = thisUser.getDefaultContext().getId();
149-
Context context = contextService.findByIdAndUserAccount(defaultContextId, thisUser);
148+
if(userSession == null){
149+
userSession = new UserSessionBean();
150+
long defaultContextId = thisUser.getDefaultContext().getId();
151+
userSession.setLastContextId(defaultContextId);
152+
}
153+
Context context = contextService.findByIdAndUserAccount(userSession.getLastContextId(), thisUser);
150154
userSession.setLastContextId(context.getId());
151155
userSession.setUserAccountid(thisUser.getId());
152156
return context;

src/main/java/org/woehlke/simpleworklist/common/AuditModel.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ public int hashCode() {
7777
public String toString() {
7878
return "AuditModel{" +
7979
"uuid='" + uuid + '\'' +
80-
", rowCreatedAt=" + rowCreatedAt +
81-
", rowUpdatedAt=" + rowUpdatedAt +
8280
'}';
8381
}
8482

src/main/java/org/woehlke/simpleworklist/user/account/UserAccount.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
@Getter
3636
@Setter
3737
@EqualsAndHashCode(callSuper = true)
38-
@ToString(callSuper = true, exclude = "userPassword")
38+
@ToString(callSuper = true, exclude = {"userPassword","defaultContext","lastLoginTimestamp"})
3939
public class UserAccount extends AuditModel implements Serializable, ComparableById<UserAccount> {
4040

4141
private static final long serialVersionUID = 7860692526488291439L;

src/main/java/org/woehlke/simpleworklist/user/register/UserRegistrationController.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
@Slf4j
1818
@Controller
19-
@RequestMapping(path = "/user")
19+
@RequestMapping(path = "/user/register")
2020
public class UserRegistrationController {
2121

2222
private final UserAccountService userAccountService;
@@ -35,7 +35,7 @@ public UserRegistrationController(UserAccountService userAccountService, UserReg
3535
* @param model
3636
* @return Formular for entering Email-Address for Registration
3737
*/
38-
@RequestMapping(path = "/register", method = RequestMethod.GET)
38+
@RequestMapping(path = "", method = RequestMethod.GET)
3939
public final String registerGet(Model model) {
4040
log.info("registerGet");
4141
UserRegistrationForm userRegistrationForm = new UserRegistrationForm();
@@ -51,7 +51,7 @@ public final String registerGet(Model model) {
5151
* @param model
5252
* @return info page at success or return to form with error messages.
5353
*/
54-
@RequestMapping(path = "/register", method = RequestMethod.POST)
54+
@RequestMapping(path = "", method = RequestMethod.POST)
5555
public final String registerPost(
5656
@Valid UserRegistrationForm userRegistrationForm,
5757
BindingResult result,
@@ -92,7 +92,7 @@ public final String registerPost(
9292
* @param model
9393
* @return Formular for Entering Account Task or Error Messages.
9494
*/
95-
@RequestMapping(path = "/register/confirm/{confirmId}", method = RequestMethod.GET)
95+
@RequestMapping(path = "/confirm/{confirmId}", method = RequestMethod.GET)
9696
public final String registerConfirmGet(
9797
@PathVariable String confirmId,
9898
Model model
@@ -120,7 +120,7 @@ public final String registerConfirmGet(
120120
* @param model
121121
* @return login page at success or page with error messages.
122122
*/
123-
@RequestMapping(path = "/register/confirm/{confirmId}", method = RequestMethod.POST)
123+
@RequestMapping(path = "/confirm/{confirmId}", method = RequestMethod.POST)
124124
public final String registerConfirmPost(
125125
@PathVariable String confirmId,
126126
@Valid UserAccountForm userAccountForm,

src/main/resources/application.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ server:
55
compression:
66
enabled: false
77
min-response-size: 2048
8-
9-
10-
server:
11-
128
spring:
139
datasource:
1410
url: jdbc:postgresql://localhost:5432//simpleworklist
@@ -80,8 +76,10 @@ org:
8076
- "/user/login*"
8177
- "/user/register*"
8278
- "/user/register/**"
79+
- "/user/register/confirm/**"
8380
- "/user/resetPassword*"
8481
- "/user/resetPassword/**"
82+
- "/user/resetPassword/confirm/**"
8583
- "/error*"
8684
strengthBCryptPasswordEncoder: 10
8785
---

0 commit comments

Comments
 (0)