diff --git a/api/src/main/java/com/backend/backend/controller/UserController.java b/api/src/main/java/com/backend/backend/controller/UserController.java index becc4d8..172f1e5 100644 --- a/api/src/main/java/com/backend/backend/controller/UserController.java +++ b/api/src/main/java/com/backend/backend/controller/UserController.java @@ -19,7 +19,7 @@ public ResponseEntity getCurrentUser() { User currentUser = (User) authentication.getPrincipal(); CurrentUserDto response = new CurrentUserDto(); response.setEmail(currentUser.getEmail()); - response.setFullName(currentUser.getFullName()); + response.setUserTag(currentUser.getUserTag()); response.setId(currentUser.getId()); return ResponseEntity.ok(response); } diff --git a/api/src/main/java/com/backend/backend/dto/CurrentUserDto.java b/api/src/main/java/com/backend/backend/dto/CurrentUserDto.java index eb3a50c..5f78379 100644 --- a/api/src/main/java/com/backend/backend/dto/CurrentUserDto.java +++ b/api/src/main/java/com/backend/backend/dto/CurrentUserDto.java @@ -6,5 +6,5 @@ public class CurrentUserDto { private Long id; private String email; - private String fullName; + private String userTag; } diff --git a/api/src/main/java/com/backend/backend/dto/RegisterUserDto.java b/api/src/main/java/com/backend/backend/dto/RegisterUserDto.java index af8dce4..d9d23d5 100644 --- a/api/src/main/java/com/backend/backend/dto/RegisterUserDto.java +++ b/api/src/main/java/com/backend/backend/dto/RegisterUserDto.java @@ -8,5 +8,5 @@ public class RegisterUserDto { private String password; - private String fullName; + private String userTag; } diff --git a/api/src/main/java/com/backend/backend/exceptions/GlobalExceptionHandler.java b/api/src/main/java/com/backend/backend/exceptions/GlobalExceptionHandler.java index cc127c9..9d30180 100644 --- a/api/src/main/java/com/backend/backend/exceptions/GlobalExceptionHandler.java +++ b/api/src/main/java/com/backend/backend/exceptions/GlobalExceptionHandler.java @@ -17,7 +17,6 @@ public class GlobalExceptionHandler { public ProblemDetail handleSecurityException(Exception exception) { ProblemDetail errorDetail = null; - // TODO send this stack trace to an observability tool exception.printStackTrace(); if (exception instanceof BadCredentialsException) { diff --git a/api/src/main/java/com/backend/backend/model/User.java b/api/src/main/java/com/backend/backend/model/User.java index b0eaebc..312f310 100644 --- a/api/src/main/java/com/backend/backend/model/User.java +++ b/api/src/main/java/com/backend/backend/model/User.java @@ -21,7 +21,7 @@ public class User implements UserDetails { private Long id; private String email; private String password; - private String fullName; + private String userTag; @OneToMany(mappedBy = "user") private Set userBoards; @@ -37,8 +37,8 @@ public String getUsername() { return email; } - public User setUsername(String username) { - this.email = username; + public User setUsername(String email) { + this.email = email; return this; } diff --git a/api/src/main/java/com/backend/backend/service/AuthenticationService.java b/api/src/main/java/com/backend/backend/service/AuthenticationService.java index d0d2197..eadbc34 100644 --- a/api/src/main/java/com/backend/backend/service/AuthenticationService.java +++ b/api/src/main/java/com/backend/backend/service/AuthenticationService.java @@ -29,7 +29,8 @@ public AuthenticationService( public User signup(RegisterUserDto input) { User user = new User() - .setFullName(input.getFullName()) + .setUserTag(input.getUserTag()) + .setUsername(input.getEmail()) .setEmail(input.getEmail()) .setPassword(passwordEncoder.encode(input.getPassword()));