Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring Security 작업 Exception 제외하고 완료 #18

Merged
merged 5 commits into from
Oct 9, 2023

Conversation

bongsh0112
Copy link
Member

Spring Security 작업 Exception 제외하고 완료

TODO

  • Auth 패키지 Exception 커스텀하기
  • Auth 패키지 Exception Handler에 Advice 추가

Copy link
Member

@donsonioc2010 donsonioc2010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수정

Comment on lines 88 to 90
} else {
log.info("Username is null or context is not null !!");
log.error("Username is null or context is not null !!");
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else문은 불필요할듯?

}
filterChain.doFilter(request, response);
}

// Filter에서 제외할 URL 설정
@Override
protected boolean shouldNotFilter(HttpServletRequest request) throws ServletException {
return EXCLUDE_URL.stream().anyMatch(exclude -> exclude.equalsIgnoreCase(request.getServletPath()));
jwtProperties.getExcludePath().forEach(path -> log.error("path: {}\n", path));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error레벨 말고 debug또는 info레벨로 수정

Comment on lines 59 to 61
claimMap.put("email", email);
claimMap.put("password", password);
claimMap.put("role", role);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

상수변수로 변경해주세요

이렇게 쓸거면 public static final 변수로 뽑고 다른 곳에서도 사용가능하게 Constants Class로 별도 지정하는게 어떨까 싶네요.

Comment on lines 10 to 11
private String email;
private String password;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private String email;
private String password;
@NotEmpty(message = "이메일 입력은 필수 입니다.")
@Pattern(regexp = "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,6}$", message = "이메일 형식에 맞지 않습니다.")
private String email
@NotEmpty(message = "패스워드 입력은 필수 입니다.")
@Size(min = 3, max = 15)
@Pattern(등등 추가)
private String password;

Copy link
Member

@donsonioc2010 donsonioc2010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

뽕쎼환

@bongsh0112 bongsh0112 merged commit 19cb064 into dev Oct 9, 2023
@bongsh0112 bongsh0112 deleted the feat/4-security-login branch October 9, 2023 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants