forked from codesquad-members-2023/issue-tracker-max
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs: oauth 회원가입을 위한 컬럼 추가 * feat: OAuth 최초 로그인시 추가 회원 정보를 받도록 기능 구현 * chore : github action deploy.yml 수정 --------- Co-authored-by: pie <[email protected]>
- Loading branch information
Showing
13 changed files
with
125 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,8 @@ name: ci | |
on: | ||
pull_request: | ||
branches: | ||
- be-w3 | ||
- fe-w3 | ||
- be-w4 | ||
- fe-w4 | ||
|
||
env: | ||
AWS_REGION: ap-northeast-2 | ||
|
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
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
14 changes: 14 additions & 0 deletions
14
backend/src/main/java/kr/codesquad/issuetracker/exception/InitialLoginException.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,14 @@ | ||
package kr.codesquad.issuetracker.exception; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public class InitialLoginException extends RuntimeException { | ||
|
||
private final String email; | ||
|
||
public InitialLoginException(String message, String email) { | ||
super(message); | ||
this.email = email; | ||
} | ||
} |
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
12 changes: 12 additions & 0 deletions
12
backend/src/main/java/kr/codesquad/issuetracker/presentation/request/OauthSignupRequest.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,12 @@ | ||
package kr.codesquad.issuetracker.presentation.request; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class OauthSignupRequest { | ||
|
||
private String email; | ||
private String username; | ||
} |
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 |
---|---|---|
|
@@ -63,6 +63,14 @@ class GithubClientTest { | |
+ " \"error_description\": \"The client_id and/or client_secret passed are incorrect.\",\n" | ||
+ " \"error_uri\": \"/apps/managing-oauth-apps/troubleshooting-oauth-app-access-token-request-errors/#incorrect-client-credentials\"\n" | ||
+ "}"; | ||
private static final String USER_EMAIL_RESPONSE = "[\n" | ||
+ " {\n" | ||
+ " \"email\": \"[email protected]\",\n" | ||
+ " \"verified\": true,\n" | ||
+ " \"primary\": true,\n" | ||
+ " \"visibility\": \"public\"\n" | ||
+ " }\n" | ||
+ "]"; | ||
|
||
@DisplayName("코드와 함께 서버로 요청을 보낼 때 사용자의 정보를 가져오는데 성공한다.") | ||
@Test | ||
|
@@ -73,6 +81,7 @@ void getOAuthUser() throws IOException { | |
|
||
setUpMockWebServer(mockGithubServer, ACCESS_TOKEN_RESPONSE); | ||
setUpMockWebServer(mockGithubServer, USER_INFO_RESPONSE); | ||
setUpMockWebServer(mockGithubServer, USER_EMAIL_RESPONSE); | ||
|
||
GithubClient githubClient = new GithubClient( | ||
new OauthProperties( | ||
|
@@ -88,7 +97,7 @@ void getOAuthUser() throws IOException { | |
GithubUser oAuthUser = githubClient.getOAuthUser("code"); | ||
|
||
// then | ||
assertThat(oAuthUser.getUsername()).isEqualTo("23Yong"); | ||
assertThat(oAuthUser.getEmail()).isEqualTo("[email protected]"); | ||
mockGithubServer.shutdown(); | ||
} | ||
|
||
|