File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ package inha .gdgoc .domain .test .controller ;
2+
3+ import inha .gdgoc .global .dto .response .ApiResponse ;
4+ import java .util .Map ;
5+ import org .springframework .http .ResponseEntity ;
6+ import org .springframework .web .bind .annotation .CookieValue ;
7+ import org .springframework .web .bind .annotation .GetMapping ;
8+ import org .springframework .web .bind .annotation .RequestHeader ;
9+ import org .springframework .web .bind .annotation .RequestMapping ;
10+ import org .springframework .web .bind .annotation .RestController ;
11+
12+ @ RestController
13+ @ RequestMapping ("/api/v1/test" )
14+ public class TestController {
15+
16+ @ GetMapping ("/login_test" )
17+ public ResponseEntity <ApiResponse <Map <String , Object >, Void >> loginTest (
18+ @ CookieValue (value = "refresh_token" , required = false ) String refreshToken ,
19+ @ RequestHeader (value = "Authorization" , required = false ) String authorization
20+ ) {
21+ boolean hasRefreshToken = refreshToken != null && !refreshToken .isBlank ();
22+ boolean hasAuthorization = authorization != null && !authorization .isBlank ();
23+
24+ Map <String , Object > data = Map .of (
25+ "has_refresh_token" , hasRefreshToken ,
26+ "has_authorization" , hasAuthorization
27+ );
28+
29+ return ResponseEntity .ok (ApiResponse .ok ("LOGIN_TEST_OK" , data ));
30+ }
31+ }
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
4545 "/v3/api-docs/**" ,
4646 "/swagger-ui.html" ,
4747 "/api/v1/auth/**" ,
48+ "/api/v1/test/**" ,
4849 "/api/v1/game/**" ,
4950 "/api/v1/apply/**" ,
5051 "/api/v1/check/**" ,
You can’t perform that action at this time.
0 commit comments