optionalMember = memberRepository.findByMemberName(requestDto.getMemberName());
+
+ if(optionalMember.isEmpty())
+ {
+ log.warn("회원이 존재하지 않습니다.");
+ throw new IllegalArgumentException("회원이 존재하지 않습니다.");
+ }
+
+ Member member = optionalMember.get();
+
+ if(!passwordEncoder.matches(requestDto.getPassword(), member.getPassword()))
+ {
+ log.warn("비밀번호가 일치하지 않습니다.");
+ throw new IllegalArgumentException("비밀번호가 일치하지 않습니다.");
+ }
+
+ Cookie cookie = new Cookie(JwtUtil.AUTHORIZATION_HEADER,
+ jwtUtil.createToken(member.getMemberName(), member.getRole()));
+
+ cookie.setMaxAge(7*24*60*60);
+ cookie.setPath("/");
+ cookie.setDomain("localhost");
+ cookie.setSecure(false);
+
+ response.addCookie(cookie);
+
+
+ }
+
+
+}
+
+
diff --git a/main-Login/src/main/resources/application.properties b/main-Login/src/main/resources/application.properties
new file mode 100644
index 0000000..25c14fa
--- /dev/null
+++ b/main-Login/src/main/resources/application.properties
@@ -0,0 +1,10 @@
+spring.application.name=main-Login
+spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
+spring.datasource.url=jdbc:mariadb://3.35.197.144:3306/users
+spring.datasource.username=root
+spring.datasource.password=1234
+spring.jpa.show-sql=true
+#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MariaDBDialect
+spring.jpa.hibernate.ddl-auto=update
+#server.port=8080
+jwt.secret.key=a42ceee07d2e44c8f05be9518836e4d48aa7d33a96732acf9e28be74a7a46746
diff --git a/main-Login/src/main/resources/templates/index.html b/main-Login/src/main/resources/templates/index.html
new file mode 100644
index 0000000..e94673b
--- /dev/null
+++ b/main-Login/src/main/resources/templates/index.html
@@ -0,0 +1,15 @@
+
+
+
+
+ Title
+
+
+로그인 성공
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/main-Login/src/main/resources/templates/login.html b/main-Login/src/main/resources/templates/login.html
new file mode 100644
index 0000000..39631c9
--- /dev/null
+++ b/main-Login/src/main/resources/templates/login.html
@@ -0,0 +1,69 @@
+
+
+
+
+ Title
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/main-Login/src/main/resources/templates/role.html b/main-Login/src/main/resources/templates/role.html
new file mode 100644
index 0000000..33d7e99
--- /dev/null
+++ b/main-Login/src/main/resources/templates/role.html
@@ -0,0 +1,55 @@
+
+
+
+
+ Title
+
+
+
+
+ ADMIN 님 안녕하세요.
+
+
+
+
+ VIP_MEMBER 님 안녕하세요.
+
+
+
+
+ 소유한 권한들 :
+
+
+
+인증된 사람만 이 글을 볼 수 있습니다.
+
+
+ name :
+
+
+
+
+ principal.username :
+
+
+
+ principal.password :
+
+
+
+ principal.enabled :
+
+
+
+ principal.accountNonLocked :
+
+
+
+ principal.accountNonExpired :
+
+
+
+ principal.credentialsNonExpired :
+
+
+
\ No newline at end of file
diff --git a/main-Login/src/main/resources/templates/signUp.html b/main-Login/src/main/resources/templates/signUp.html
new file mode 100644
index 0000000..82df29a
--- /dev/null
+++ b/main-Login/src/main/resources/templates/signUp.html
@@ -0,0 +1,49 @@
+
+
+
+
+ Title
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/main-Login/src/test/java/main/spring/login/mainlogin/MainLoginApplicationTests.java b/main-Login/src/test/java/main/spring/login/mainlogin/MainLoginApplicationTests.java
new file mode 100644
index 0000000..5f71fbc
--- /dev/null
+++ b/main-Login/src/test/java/main/spring/login/mainlogin/MainLoginApplicationTests.java
@@ -0,0 +1,13 @@
+package main.spring.login.mainlogin;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class MainLoginApplicationTests {
+
+ @Test
+ void contextLoads() {
+ }
+
+}