-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GWL-268] 로그인 회원가입 연결 및 서버통신 #297
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
51762a0
fix: CircularDepedency 현상 개선
JongPyoAhn ddcac9a
chore: 중복 Mutipart제거
JongPyoAhn b5602ba
docs: 주석 제거
JongPyoAhn 55d71b6
chore: MultiPart-Trinet 재결합
JongPyoAhn 2c43ec2
feat: Trinet No Interceptor Upload
JongPyoAhn 30f3178
rename: userBit -> newUserInformation
JongPyoAhn e907399
rename: userBit-newUserInformation
JongPyoAhn 47062c7
fix: SignUp넘어갈 때, mainThread 에러 수정
JongPyoAhn e8bcad0
fix: ImageForm데이터 전달 안되는 현상 개선 및 회원가입 완료 시 받아온 토큰값 저장하는 로직 작성
JongPyoAhn 4f5a905
chore: Lint 정상화
JongPyoAhn 58d639e
fix: SignUpGenderBirth에서 SignUpProfile까지 성별벌스 데이터 이동안되는 현상 개선
JongPyoAhn 929172f
Login, SignUp, TabBar Coordinator 연결
JongPyoAhn 5b8e43c
add: Auth모듈 추가
JongPyoAhn a1375b0
add: Auth모듈에 Token Entity
JongPyoAhn a55e413
add: Auth모듈에 AuthProvider추가
JongPyoAhn 8695a5a
chore: Token접근제어자 수정
JongPyoAhn 6dd8a37
feat: 로그인 완료 시, 분기처리
JongPyoAhn d647ec1
fix: Encoder로 인해 액세스토큰이 키체인에 쌍따옴표가 붙어서 저장되는 현상 개선
JongPyoAhn 376e072
Merge branch 'develop' into feature/iOS/GWL-268
WhiteHyun e9b9603
chore: lint 복구
WhiteHyun 6d010f5
fix: merge conflict
JongPyoAhn 2332606
fix: form-Data 이미지 그린아이에서 튕기는 현상 개선 이유 : fileName
JongPyoAhn 9ff660a
chore: 피드백 반영
JongPyoAhn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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 |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
"mappedUserID": "1233498sdafksdjhfk...", | ||
"provider": "apple" | ||
} | ||
} |
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
// Copyright © 2023 kr.codesquad.boostcamp8. All rights reserved. | ||
// | ||
|
||
import Auth | ||
import Combine | ||
import Foundation | ||
import Log | ||
|
@@ -16,6 +17,7 @@ import Trinet | |
enum AuthorizationRepositoryError: Error { | ||
case invalidData | ||
case failureDecode | ||
case resonseDecodingError | ||
} | ||
|
||
// MARK: - AuthorizationRepository | ||
|
@@ -32,19 +34,16 @@ struct AuthorizationRepository: AuthorizationRepositoryRepresentable { | |
return Future<LoginResponse, Never> { promise in | ||
Task { | ||
do { | ||
guard let token = String(data: authorizationInfo.identityToken, encoding: .utf8), | ||
let authorizationCode = String(data: authorizationInfo.authorizationCode, encoding: .utf8) | ||
else { | ||
return | ||
} | ||
let authorizationInfoRequestDTO = AuthorizationInfoRequestDTO(identityToken: token, authorizationCode: authorizationCode) | ||
let token = String(decoding: authorizationInfo.identityToken, as: UTF8.self) | ||
let authorizationCode = String(decoding: authorizationInfo.authorizationCode, as: UTF8.self) | ||
|
||
let data = try await provider.request(.signIn(authorizationInfoRequestDTO)) | ||
|
||
guard let responseCode = try decoder.decode(Response.self, from: data).code else { | ||
return | ||
let authorizationInfoRequestDTO = AuthorizationInfoRequestDTO(identityToken: token, authorizationCode: authorizationCode) | ||
let (data, response) = try await provider.requestResponse(.signIn(authorizationInfoRequestDTO)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. p2 |
||
guard let urlResponse = response as? HTTPURLResponse else { | ||
throw AuthorizationRepositoryError.resonseDecodingError | ||
} | ||
switch responseCode { | ||
let statusCode = urlResponse.statusCode | ||
switch statusCode { | ||
case AuthorizationRepositoryResponseCode.token.code: | ||
let token = try decoder.decode(GWResponse<Token>.self, from: data).data | ||
promise(.success((token, nil))) | ||
|
@@ -71,7 +70,7 @@ enum AuthorizationRepositoryEndPoint: TNEndPoint { | |
var path: String { | ||
switch self { | ||
case .signIn: | ||
return "auth/apple/signin" | ||
return "/api/v1/auth/apple/signin" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이부분을 이렇게 쓰면 , api 버전이 높아지면 어떻게 될까요? p3 |
||
} | ||
} | ||
|
||
|
@@ -94,9 +93,7 @@ enum AuthorizationRepositoryEndPoint: TNEndPoint { | |
} | ||
|
||
var headers: TNHeaders { | ||
return .init(headers: [ | ||
// TODO: 헤더 설정 | ||
]) | ||
return .default | ||
} | ||
} | ||
|
||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3
우리가 처음에 했떤 Request랑 비슷한 것 같은데, 어떤 것이 다른가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
URLResponse에서 Status코드를 꺼내오기 위해서 해당 메소드를 추가했습니다!