Skip to content

Commit

Permalink
fix : Authorization header 상수 삭제
Browse files Browse the repository at this point in the history
- Spring 제공 Header로 변경
Open #12
  • Loading branch information
seokho-1116 committed Jan 11, 2024
1 parent 56e0eb1 commit 8fa1920
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
Expand All @@ -19,7 +20,6 @@
public class JwtAuthenticationFilter extends OncePerRequestFilter {

private static final int PREFIX_LENGTH = 7;
private static final String AUTHORIZATION_HEADER = JwtConstants.TOKEN_TYPE.getValue();
private static final String TOKEN_TYPE = JwtConstants.TOKEN_TYPE.getValue();

private final AuthenticationManager authenticationManager;
Expand Down Expand Up @@ -52,7 +52,7 @@ protected void doFilterInternal(
}

private String extractAccessToken(HttpServletRequest request) {
String token = request.getHeader(AUTHORIZATION_HEADER);
String token = request.getHeader(HttpHeaders.AUTHORIZATION);

if (isNotValidFormat(token)) {
return "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
@RequiredArgsConstructor
public enum JwtConstants {
MEMBER_ID("memberId"),
AUTHORIZATION_HEADER("Authorization"),
TOKEN_TYPE("Bearer "),
MEMBER_INFO_KEY("memberInfoKey");

Expand Down

0 comments on commit 8fa1920

Please sign in to comment.