UserController

This commit is contained in:
Jacob Salvi 2020-02-25 16:07:48 +01:00
parent 423e17ecb8
commit 7195e999ea

View file

@ -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";
}
*/
}