-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Feature/#1 oauth login
- Loading branch information
Showing
14 changed files
with
287 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
backend/src/main/java/com/ssafy/home/domain/member/dto/response/FindPasswordResponse.java
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
backend/src/main/java/com/ssafy/home/domain/member/dto/response/ProfileResponse.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
backend/src/main/java/com/ssafy/home/global/auth/constant/EmailConstraints.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.ssafy.home.global.auth.constant; | ||
|
||
public final class EmailConstraints { | ||
// Util로 빼기 constant 로 넘기기 (상수 | ||
public static final String MAIL_TITLE = "where-is-my-home의 비밀번호 변경 이메일 입니다."; | ||
|
||
public static final char[] charSet = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', | ||
'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' }; | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
backend/src/main/java/com/ssafy/home/global/auth/util/SendEmailLogic.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.ssafy.home.global.auth.util; | ||
|
||
import com.ssafy.home.global.auth.constant.EmailConstraints; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.thymeleaf.context.Context; | ||
import org.thymeleaf.spring6.SpringTemplateEngine; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class SendEmailLogic { | ||
|
||
private final SpringTemplateEngine templateEngine; | ||
|
||
public String makeRandomPassword(){ | ||
|
||
StringBuilder pw = new StringBuilder(); | ||
|
||
for (int i = 0; i < 10; i++) { | ||
int idx = (int) (EmailConstraints.charSet.length * Math.random()); | ||
pw.append(EmailConstraints.charSet[idx]); | ||
} | ||
|
||
return String.valueOf(pw); | ||
} | ||
|
||
public String setContext(String code, String type) { | ||
Context context = new Context(); | ||
context.setVariable("code", code); | ||
return templateEngine.process(type, context); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
backend/src/main/java/com/ssafy/home/global/config/batch/ScheduledJobConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.ssafy.home.global.config.batch; | ||
|
||
import com.ssafy.home.domain.member.service.MemberService; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.scheduling.annotation.Scheduled; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@Slf4j | ||
@RequiredArgsConstructor | ||
public class ScheduledJobConfiguration { | ||
private final MemberService memberService; | ||
|
||
@Scheduled(cron ="0 30 * * * *", zone = "Asia/Seoul") | ||
public void scheduledEndForm() { | ||
memberService.initAttempt(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
spring: | ||
sql: | ||
init: | ||
mode: always | ||
|
||
datasource: | ||
url: jdbc:h2:mem:test | ||
driverClassName: org.h2.Driver | ||
username: sa | ||
password: | ||
|
||
jpa: | ||
hibernate: | ||
ddl-auto: create-drop | ||
database-platform: org.hibernate.dialect.H2Dialect | ||
show-sql: true | ||
properties: | ||
hibernate: | ||
format_sql: true | ||
#데이터베이스 초기화를 지연시키는 옵션. true 로 설정을하면 애플리케이션이 실행될 때 db를 초기화하지 않고 첫 데이터베이스 액세스 시 초기화를 수행(data.sql문 실행)한다. | ||
defer-datasource-initialization: true | ||
generate-ddl: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
INSERT INTO member (create_date, email, is_deleted, modify_date, name, profile, refresh_token, id) | ||
VALUES (TIMESTAMP '2024-05-19 00:00:00', '[email protected]', false, TIMESTAMP '2024-05-19 00:00:00', 'test', NULL, '', 11); | ||
|
||
INSERT INTO general_member (member_id, user_enc_password, id) | ||
VALUES (11, '2492b60365ec438c50a4b37302790e61000eaf6866338c4f39d5d7c1cfdd4b78', 11); | ||
|
||
INSERT INTO member_secret (member_id, salt, id) | ||
VALUES (11, '7b6fcbe49833ef658d3f87e2cec1b83c', DEFAULT); | ||
|
||
INSERT INTO login_attempt (count, login_recent_attemp, member_id, id) | ||
VALUES (0, TIMESTAMP '2024-05-19 00:00:00', 11, DEFAULT); |
Oops, something went wrong.