@@ -83,8 +83,17 @@ protected void successfulAuthentication(HttpServletRequest request, HttpServletR
8383 log .info ("successfulAuthentication > publicId : {}" , publicId );
8484 log .info ("successfulAuthentication > status : {}" , status );
8585
86+ Collection <? extends GrantedAuthority > authorities = authentication .getAuthorities ();
87+ Iterator <? extends GrantedAuthority > iterator = authorities .iterator ();
88+ GrantedAuthority auth = iterator .next ();
89+
8690 if (status .equals (PENDING .name ())) {
8791 log .warn ("PENDING 상태인 경우 로그인이 불가능합니다" );
92+ // X-Refresh-Token
93+ String refreshToken = jwtProvider .generateToken (TOKEN_CATEGORY_REFRESH , Duration .ofHours (24 ), publicId , auth .getAuthority (), status );
94+ String cookieValue = URLEncoder .encode ("Bearer " + refreshToken , StandardCharsets .UTF_8 );
95+
96+ response .addCookie (createCookie (REFRESH_TOKEN_KEY , cookieValue , TOKEN_REISSUE_PATH , 5 * 60 , true ));
8897 sendErrorResponse (response , HttpStatus .LOCKED , "PENDING 상태인 경우 로그인이 불가능합니다" );
8998 return ;
9099 } else if (status .equals (INACTIVE .name ())) {
@@ -97,10 +106,6 @@ protected void successfulAuthentication(HttpServletRequest request, HttpServletR
97106 return ;
98107 }
99108
100- Collection <? extends GrantedAuthority > authorities = authentication .getAuthorities ();
101- Iterator <? extends GrantedAuthority > iterator = authorities .iterator ();
102- GrantedAuthority auth = iterator .next ();
103-
104109 // 권한 획득
105110 String role = auth .getAuthority ();
106111
0 commit comments