From c1182ea053c10bba79a029449c3394c8bac72189 Mon Sep 17 00:00:00 2001 From: Kimsangwon Date: Wed, 12 Jun 2024 01:08:55 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20JWT=20=EC=98=88=EC=99=B8=20API=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.이메일 중복 확인 API 2.닉네임 중복 확인 API 3.Swagger 진입 4.초대 수락 --- .../main/java/com/Backend/shareNote/domain/Jwt/JWTFilter.java | 4 +++- .../com/Backend/shareNote/domain/config/SecurityConfig.java | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/shareNote/src/main/java/com/Backend/shareNote/domain/Jwt/JWTFilter.java b/backend/shareNote/src/main/java/com/Backend/shareNote/domain/Jwt/JWTFilter.java index 836aa0e0..3fb4c9dd 100644 --- a/backend/shareNote/src/main/java/com/Backend/shareNote/domain/Jwt/JWTFilter.java +++ b/backend/shareNote/src/main/java/com/Backend/shareNote/domain/Jwt/JWTFilter.java @@ -23,7 +23,9 @@ @Slf4j public class JWTFilter extends OncePerRequestFilter { private final JWTUtil jwtUtil; - private final List permitAllUrls = List.of("/api/user/login", "/api/user/signUp", "/", "/api/user/reissue", "/api/user/cookieToJwt"); + + private final List permitAllUrls = List.of("/api/user/login", "/api/user/signUp", "/", "/api/user/reissue", + "/api/user/cookieToJwt","/user/uniqueEmail/**","/user/uniqueNickname/**","/swagger-ui.html","/api/user/organization/invitation/accept"); @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { String requestURI = request.getRequestURI(); diff --git a/backend/shareNote/src/main/java/com/Backend/shareNote/domain/config/SecurityConfig.java b/backend/shareNote/src/main/java/com/Backend/shareNote/domain/config/SecurityConfig.java index 20b20db1..4006f8fa 100644 --- a/backend/shareNote/src/main/java/com/Backend/shareNote/domain/config/SecurityConfig.java +++ b/backend/shareNote/src/main/java/com/Backend/shareNote/domain/config/SecurityConfig.java @@ -108,9 +108,9 @@ public CorsConfiguration getCorsConfiguration(HttpServletRequest request) { // 경로별 인가 작업 http .authorizeHttpRequests((auth -> auth - .requestMatchers("/api/user/login","/","/api/user/signUp").permitAll() + .requestMatchers("/api/user/login","/","/api/user/signUp","/api/user/organization/invitation/accept").permitAll() .requestMatchers("/admin").hasRole("ADMIN") - .requestMatchers("/api/user/reissue","/api/user/cookieToJwt").permitAll() + .requestMatchers("/api/user/reissue","/api/user/cookieToJwt","/user/uniqueEmail/**","/user/uniqueNickname/**","/swagger-ui.html","/user/reissue").permitAll() .anyRequest().authenticated()) ); http.addFilterAfter(new JWTFilter(jwtUtil), OAuth2LoginAuthenticationFilter.class);