Skip to content

Commit

Permalink
Merge pull request #102 from APPS-sookmyung/fix/73-login
Browse files Browse the repository at this point in the history
[Fix/73-fixLogin] jwt 에러 status 수정
  • Loading branch information
hagoeun0119 authored Feb 3, 2024
2 parents 9cdde04 + d7d5d78 commit 1ef30fa
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import io.jsonwebtoken.JwtException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
Expand Down Expand Up @@ -74,8 +75,8 @@ public void jwtExceptionHandler(HttpServletResponse response, Throwable error) t
body.put("isSuccess", false);
body.put("code", HttpServletResponse.SC_UNAUTHORIZED);
ObjectMapper mapper = new ObjectMapper();
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
mapper.writeValue(response.getOutputStream(), body);
response.setStatus(HttpServletResponse.SC_OK);
}
}

0 comments on commit 1ef30fa

Please sign in to comment.