-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Description
In order to create the authentication token at the SecurityServiceImpl class, it's needed to pass to the constructor the password in plain text.
I recommend saving the password in registration mapping and then pass it to autologin.
Example:
@PostMapping("/registration")
public String registration(@ModelAttribute("userForm") User userForm, BindingResult bindingResult) {
String pw = userForm.getPassword();
userValidator.validate(userForm, bindingResult);
if (bindingResult.hasErrors()) {
return "registration";
}
userService.save(userForm);
securityService.autoLogin(userForm.getUsername(), pw);
return "redirect:/welcome";
}Metadata
Metadata
Assignees
Labels
No labels