-
Notifications
You must be signed in to change notification settings - Fork 8
[10주차/미녁] 워크북 제출합니다 #58
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
base: minyuk/main
Are you sure you want to change the base?
Conversation
kfdsy0103
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10주차 워크북 수행하시느라 수고 많으셨어요 미녁!
리뷰 확인 후 머지 부탁드립니다!
| @PostMapping("/login") | ||
| ApiResponse<MemberResDTO.LoginDTO> login( | ||
| @RequestBody @Valid MemberReqDTO.LoginDTO dto | ||
| ) { | ||
| return ApiResponse.onSuccess(MemberSuccessCode.FOUND, memberQueryService.login(dto)); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
로그인/회원가입 같은 권한 관련 코드는 따로 Auth 패키지 파서 분리해줘도 좋아보여요!
| http | ||
| .authorizeHttpRequests(requests -> requests | ||
| .requestMatchers(allowUris).permitAll() | ||
| .requestMatchers("/admin/**").hasRole("ADMIN") | ||
| .anyRequest().authenticated() | ||
| ) | ||
| // 폼로그인 비활성화 | ||
| .formLogin(AbstractHttpConfigurer::disable) | ||
| // JwtAuthFilter를 UsernamePasswordAuthenticationFilter | ||
| .addFilterBefore(jwtAuthFilter(), UsernamePasswordAuthenticationFilter.class) | ||
| .csrf(AbstractHttpConfigurer::disable) | ||
| .logout(logout -> logout | ||
| .logoutUrl("/logout") | ||
| .logoutSuccessUrl("/login?logout") | ||
| .permitAll() | ||
| ) | ||
| .exceptionHandling(exception -> exception.authenticationEntryPoint(authenticationEntryPoint())) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JWT를 사용하는 경우 session 비활성화를 명시해주는 것도 좋아보여요!
http
.sessionManagement(session ->
session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
)
✅ 실습 체크리스트
✅ 컨벤션 체크리스트
📌 주안점