UserController
This commit is contained in:
parent
423e17ecb8
commit
7195e999ea
1 changed files with 30 additions and 0 deletions
|
@ -0,0 +1,30 @@
|
||||||
|
package ch.usi.inf.sa4.sanmarinoes.smarthut.controller;
|
||||||
|
|
||||||
|
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.SecurityService;
|
||||||
|
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.UserService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
public class UserController {
|
||||||
|
@Autowired private UserService userService;
|
||||||
|
|
||||||
|
@Autowired private SecurityService securityService;
|
||||||
|
|
||||||
|
/*
|
||||||
|
@PostMapping("/registration")
|
||||||
|
public String registration(@ModelAttribute("userForm") User userForm, BindingResult bindingResult) {
|
||||||
|
userValidator.validate(userForm, bindingResult);
|
||||||
|
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
return "registration";
|
||||||
|
}
|
||||||
|
|
||||||
|
userService.save(userForm);
|
||||||
|
|
||||||
|
securityService.autoLogin(userForm.getUsername(), userForm.getPasswordConfirm());
|
||||||
|
|
||||||
|
return "redirect:/welcome";
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
Loading…
Reference in a new issue