mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2024-11-10 18:00:11 +01:00
fixes
This commit is contained in:
parent
c4ad442ec3
commit
d8cf7e81b9
@ -28,7 +28,6 @@ import jakarta.servlet.http.HttpServletResponse;
|
|||||||
import stirling.software.SPDF.config.security.UserService;
|
import stirling.software.SPDF.config.security.UserService;
|
||||||
import stirling.software.SPDF.model.Role;
|
import stirling.software.SPDF.model.Role;
|
||||||
import stirling.software.SPDF.model.User;
|
import stirling.software.SPDF.model.User;
|
||||||
import stirling.software.SPDF.model.api.misc.OptimizePdfRequest;
|
|
||||||
import stirling.software.SPDF.model.api.user.UpdateUserDetails;
|
import stirling.software.SPDF.model.api.user.UpdateUserDetails;
|
||||||
import stirling.software.SPDF.model.api.user.UsernameAndPass;
|
import stirling.software.SPDF.model.api.user.UsernameAndPass;
|
||||||
|
|
||||||
@ -41,8 +40,7 @@ public class UserController {
|
|||||||
|
|
||||||
@PreAuthorize("!hasAuthority('ROLE_DEMO_USER')")
|
@PreAuthorize("!hasAuthority('ROLE_DEMO_USER')")
|
||||||
@PostMapping("/register")
|
@PostMapping("/register")
|
||||||
public String register(
|
public String register(@ModelAttribute UsernameAndPass requestModel, Model model) {
|
||||||
@ModelAttribute UsernameAndPass requestModel, Model model) {
|
|
||||||
if (userService.usernameExists(requestModel.getUsername())) {
|
if (userService.usernameExists(requestModel.getUsername())) {
|
||||||
model.addAttribute("error", "Username already exists");
|
model.addAttribute("error", "Username already exists");
|
||||||
return "register";
|
return "register";
|
||||||
@ -61,7 +59,6 @@ public class UserController {
|
|||||||
HttpServletResponse response,
|
HttpServletResponse response,
|
||||||
RedirectAttributes redirectAttributes) {
|
RedirectAttributes redirectAttributes) {
|
||||||
|
|
||||||
|
|
||||||
String currentPassword = requestModel.getPassword();
|
String currentPassword = requestModel.getPassword();
|
||||||
String newPassword = requestModel.getNewPassword();
|
String newPassword = requestModel.getNewPassword();
|
||||||
String newUsername = requestModel.getNewUsername();
|
String newUsername = requestModel.getNewUsername();
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package stirling.software.SPDF.model.api.user;
|
package stirling.software.SPDF.model.api.user;
|
||||||
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
Loading…
Reference in New Issue
Block a user