Skip to content

Commit

Permalink
fix: 시큐리티 설정 & OAuth 응답 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kimday0326 committed Feb 20, 2024
1 parent 32d9c80 commit 30dcdf8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ private RequestMatcher[] requestPermitAll() {
antMatcher("/h2-console/**"),
antMatcher("/api/v1/sse"),
antMatcher("/api/v1/auth/login"),
antMatcher("/api/v1/auth/guest"),
antMatcher("/api/v1/members/sign-up"),
antMatcher(GET, "/api/v1/rooms")
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.pgms.coresecurity.handler;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -51,12 +52,12 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo
String accessToken = jwtTokenProvider.createAccessToken(userDetails);
String refreshToken = jwtTokenProvider.createRefreshToken();

redisRepository.saveRefreshToken(accessToken, member.getId());
redisRepository.saveRefreshToken(refreshToken, member.getId());

Map<String, Object> body = new HashMap<>();
body.put("accessToken", accessToken);
body.put("refreshToken", refreshToken);

Map<String, Object> body = Map.of(
"accessToken", accessToken,
"refreshToken", refreshToken
);
HttpResponseUtil.setSuccessResponse(response, HttpStatus.OK, body);
}

Expand Down

0 comments on commit 30dcdf8

Please sign in to comment.