From 2f9a53196bdbb2fd6750fb00cfc8b1f900913b5a Mon Sep 17 00:00:00 2001 From: Ganghee-Lee-0522 Date: Sat, 13 Jan 2024 05:44:26 +0900 Subject: [PATCH] . --- .../committersserver/auth/config/OAuth2SuccessHandler.java | 3 +++ .../domain/commit/service/CommitService.java | 4 ++++ .../domain/member/service/AuthService.java | 7 +++++++ 3 files changed, 14 insertions(+) diff --git a/src/main/java/com/committers/snowflowerthon/committersserver/auth/config/OAuth2SuccessHandler.java b/src/main/java/com/committers/snowflowerthon/committersserver/auth/config/OAuth2SuccessHandler.java index 004debb..18a4922 100644 --- a/src/main/java/com/committers/snowflowerthon/committersserver/auth/config/OAuth2SuccessHandler.java +++ b/src/main/java/com/committers/snowflowerthon/committersserver/auth/config/OAuth2SuccessHandler.java @@ -60,10 +60,13 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo // 로그인 CustomToken token = authService.setToken(optionalMember.get(), response); + /* if (!isNew) { // 기가입 유저 memberService.refreshSnowflake(optionalMember.get()); } + */ + // Auth 컨트롤러로 리다이렉트 // 를 하지마 // String redirectUrl = UriComponentsBuilder.fromUriString("/api/auth/redirect") diff --git a/src/main/java/com/committers/snowflowerthon/committersserver/domain/commit/service/CommitService.java b/src/main/java/com/committers/snowflowerthon/committersserver/domain/commit/service/CommitService.java index 179b0d0..85fc5af 100644 --- a/src/main/java/com/committers/snowflowerthon/committersserver/domain/commit/service/CommitService.java +++ b/src/main/java/com/committers/snowflowerthon/committersserver/domain/commit/service/CommitService.java @@ -30,6 +30,7 @@ public class CommitService { @Transactional public Long setSnowflake(OAuth2MemberDto memberDto) { + /* log.info("첫 가입 시 눈송이 설정: setSnowflake"); log.info("memberDto -> {}", memberDto.getNickname()); @@ -56,5 +57,8 @@ public Long setSnowflake(OAuth2MemberDto memberDto) { log.info("커밋 저장 되었는지 조회: commitRepository.findById -> {}", commitRepository.findById(commit.getId())); return totalCommits; + + */ + return 100L; } } diff --git a/src/main/java/com/committers/snowflowerthon/committersserver/domain/member/service/AuthService.java b/src/main/java/com/committers/snowflowerthon/committersserver/domain/member/service/AuthService.java index 81e28cb..e7f7709 100644 --- a/src/main/java/com/committers/snowflowerthon/committersserver/domain/member/service/AuthService.java +++ b/src/main/java/com/committers/snowflowerthon/committersserver/domain/member/service/AuthService.java @@ -53,6 +53,7 @@ public HttpServletResponse login(HttpServletResponse response, String accessToke public CustomToken setToken(Member member, HttpServletResponse response) { + /* log.info("로그인 로직"); HashMap m = new HashMap<>(); @@ -71,6 +72,12 @@ public CustomToken setToken(Member member, HttpServletResponse response) { .build(); log.info("{}", token); + */ + + CustomToken token = CustomToken.builder() + .accessToken("eyJhbGciOiJIUzI1NiJ9.eyJuaWNrbmFtZSI6IkdhbmdoZWUtTGVlLTA1MjIiLCJtZW1iZXJJZCI6MSwicm9sZSI6IlJPTEVfTUVNQkVSIiwiaWF0IjoxNzA1MDkwNjYwLCJleHAiOjE3MDc2ODI2NjB9.2O0vunX-WkIUI9oMDOdL9OnSz1sWuZzDiJTBdMdIkEk") + .refreshToken("eyJhbGciOiJIUzI1NiJ9.eyJuaWNrbmFtZSI6IkdhbmdoZWUtTGVlLTA1MjIiLCJtZW1iZXJJZCI6MSwicm9sZSI6IlJPTEVfTUVNQkVSIiwiaWF0IjoxNzA1MDkwNjYwLCJleHAiOjE3MDc2ODI2NjB9.2O0vunX-WkIUI9oMDOdL9OnSz1sWuZzDiJTBdMdIkEk") + .build(); return token; }