Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public BaseResponse<RefreshResponse> refreshToken(
"- 처리: Refresh 무효화(선택), Access 블랙리스트 등록.\n" +
"- 성공 시 200(OK)."
)
@DeleteMapping("/logout")
@PostMapping("/logout")
public BaseResponse<Void> logout(
@RequestHeader("Authorization")
@Parameter(name = "Authorization", description = "Access Token. 형식: `Bearer <token>`", required = true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
package com.assu.server.domain.chat.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.simp.config.ChannelRegistration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.web.socket.config.annotation.*;

@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {


@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/ws/chat") // 클라이언트 WebSocket 연결 지점
registry.addEndpoint("/ws") // 클라이언트 WebSocket 연결 지점
.setAllowedOriginPatterns(
"*",
"https://assu.shop",
"http://localhost:63342",
"http://localhost:5173", // Vite 기본
"http://localhost:3000", // CRA/Next 기본
"http://127.0.0.1:*",
"http://192.168.*.*:*") // 같은 LAN의 실제 기기 테스트용
.withSockJS(); // fallback for old browsers
"http://192.168.*.*:*"); // 같은 LAN의 실제 기기 테스트용
// fallback for old browsers

// ✅ 모바일/안드로이드용 (네이티브 WebSocket)
registry.addEndpoint("/ws/chat-native")
.setAllowedOriginPatterns("*"); // wss 사용 시 TLS 세팅
}

@Override
public void configureMessageBroker(MessageBrokerRegistry registry) {
registry.setApplicationDestinationPrefixes("/pub"); // 클라이언트가 보내는 prefix
registry.enableSimpleBroker("/sub"); // 서버가 보내는 prefix
registry.enableSimpleBroker("/certification"); // 인증현황을 받아보기 위한 구독 주소
registry.setApplicationDestinationPrefixes("/app"); // 클라이언트가 인증 요청을 보내는 주소
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public enum SuccessStatus implements BaseCode {
MEMBER_CREATED(HttpStatus.CREATED, "MEMBER_201", "성공적으로 생성되었습니다."),

//인증 관련 성공
SEND_AUTH_NUMBER_SUCCESS(HttpStatus.OK, "AUTH_200", "성공적으로 조회되었습니다."),
SEND_AUTH_NUMBER_SUCCESS(HttpStatus.OK, "AUTH_200", "성공적으로 전송되었습니다."),
VERIFY_AUTH_NUMBER_SUCCESS(HttpStatus.OK, "AUTH_201", "성공적으로 생성되었습니다."),

//신고 성공
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ public SecurityFilterChain filterChain(HttpSecurity http, JwtAuthFilter jwtAuthF
"/swagger-resources/**", "/webjars/**"
).permitAll()

// 로그아웃은 인증 필요
.requestMatchers("/auth/logout").authenticated()

.requestMatchers(// Auth (로그아웃 제외)
"/auth/phone-verification/send",
"/auth/phone-verification/verify",
Expand Down