From 0bcd7b43a6d8e320efb96ca3b70fdf264e24589b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EA=B5=90=ED=9C=98?= Date: Thu, 2 Jan 2025 15:51:45 +0900 Subject: [PATCH] samesite --- .../config/oauth2/CustomSuccessHandler.java | 2 +- .../soongsil/CoffeeChat/util/sms/SmsUtil.java | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/soongsil/CoffeeChat/config/oauth2/CustomSuccessHandler.java b/src/main/java/com/soongsil/CoffeeChat/config/oauth2/CustomSuccessHandler.java index 9fe34b6..e8077d8 100644 --- a/src/main/java/com/soongsil/CoffeeChat/config/oauth2/CustomSuccessHandler.java +++ b/src/main/java/com/soongsil/CoffeeChat/config/oauth2/CustomSuccessHandler.java @@ -158,7 +158,7 @@ private void addSameSiteCookie(HttpServletResponse response, String name, String .httpOnly(true) .secure(true) .maxAge(24 * 60 * 60) - //.domain("coffeego-ssu.web.app") // 정확한 도메인 설정 + .domain("coffeego-ssu.web.app") // 정확한 도메인 설정 .path("/") .sameSite("None") .build(); diff --git a/src/main/java/com/soongsil/CoffeeChat/util/sms/SmsUtil.java b/src/main/java/com/soongsil/CoffeeChat/util/sms/SmsUtil.java index 3c2dc3e..e026bb2 100644 --- a/src/main/java/com/soongsil/CoffeeChat/util/sms/SmsUtil.java +++ b/src/main/java/com/soongsil/CoffeeChat/util/sms/SmsUtil.java @@ -55,6 +55,34 @@ public String sendOne(String to) { return verificationCode; } + public String sendCogo(String menteePhoneNum, String mentorPhoneNum) { + Message message1 = new Message(); + //전송메시지 생성 + message1.setFrom(from); + message1.setTo(menteePhoneNum); + message1.setText("[COGO] 멘토링이 성사되었습니다.\n" + mentorPhoneNum+"으로 멘토님께 연락해 보세요!"); + Message message2 = new Message(); + //전송메시지 생성 + message2.setFrom(from); + message2.setTo(mentorPhoneNum); + message2.setText("[COGO] 멘토링이 성사되었습니다.\n" + menteePhoneNum+"으로 멘티님께 연락해 보세요!"); + + try { + // 메시지 전송 + messageService.send(message1); + messageService.send(message2); + } catch (NurigoMessageNotReceivedException exception) { + // 발송에 실패한 메시지 목록을 확인할 수 있습니다. + System.out.println("Failed message list: " + exception.getFailedMessageList()); + System.out.println("Error message: " + exception.getMessage()); + return null; + } catch (Exception exception) { + System.out.println("Error message: " + exception.getMessage()); + return null; + } + return "문자 전송 완료"; + } + private String generateVerificationCode() { Random random = new Random(); int code = random.nextInt(9000) + 1000; // 4자리 랜덤 숫자 생성