Skip to content

Commit

Permalink
backend: update fullName to userTag
Browse files Browse the repository at this point in the history
  • Loading branch information
jaszki committed Aug 17, 2024
1 parent 8ecd41f commit 86a988e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public ResponseEntity<CurrentUserDto> 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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
public class CurrentUserDto {
private Long id;
private String email;
private String fullName;
private String userTag;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ public class RegisterUserDto {

private String password;

private String fullName;
private String userTag;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions api/src/main/java/com/backend/backend/model/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<UserBoard> userBoards;
Expand All @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()));

Expand Down

0 comments on commit 86a988e

Please sign in to comment.