-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feat] #468 - Apple에서 받은 identityToken으로 메이커스 로그인 api 연동
- Loading branch information
Showing
17 changed files
with
215 additions
and
57 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
33 changes: 33 additions & 0 deletions
33
SOPT-iOS/Projects/Data/Sources/Repository/CoreOAuthRepository.swift
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,33 @@ | ||
// | ||
// CoreOAuthRepository.swift | ||
// Data | ||
// | ||
// Created by 장석우 on 1/18/25. | ||
// Copyright © 2025 SOPT-iOS. All rights reserved. | ||
// | ||
|
||
import Combine | ||
import Foundation | ||
|
||
import Domain | ||
import Networks | ||
|
||
public class CoreOAuthRepository { | ||
|
||
private let appleService: AuthenticationService | ||
// private let googleService: | ||
|
||
public init(appleService: AuthenticationService) { | ||
self.appleService = appleService | ||
} | ||
} | ||
|
||
extension CoreOAuthRepository: CoreOAuthRepositoryInterface { | ||
public func getIdentityToken(from provider: OAuthType) -> AnyPublisher<String, Domain.CoreAuthError> { | ||
switch provider { | ||
case .apple: return appleService.getIdentityToken() | ||
case .google: fatalError() //TODO: | ||
} | ||
|
||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
SOPT-iOS/Projects/Data/Sources/Transform/LoginTransform.swift
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,31 @@ | ||
// | ||
// LoginTransform.swift | ||
// Data | ||
// | ||
// Created by 장석우 on 1/18/25. | ||
// Copyright © 2025 SOPT-iOS. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
import Domain | ||
import Networks | ||
|
||
extension CoreLoginRequestEntity { | ||
static func dto(token: String, oauthType: OAuthType) -> Self { | ||
var platform: PlatformType | ||
|
||
switch oauthType { | ||
case .apple: platform = .apple | ||
case .google: platform = .google | ||
} | ||
|
||
return .init(token: token, authPlatform: platform) | ||
} | ||
} | ||
|
||
extension CoreLoginEntity { | ||
public func toDomain() -> CoreAuthTokens { | ||
.init(accessToken: accessToken, refreshToken: refreshToken) | ||
} | ||
} |
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
19 changes: 19 additions & 0 deletions
19
SOPT-iOS/Projects/Domain/Sources/Model/CoreAuthTokens.swift
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 @@ | ||
// | ||
// CoreAuthTokens.swift | ||
// Domain | ||
// | ||
// Created by 장석우 on 1/18/25. | ||
// Copyright © 2025 SOPT-iOS. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct CoreAuthTokens { | ||
public let accessToken: String | ||
public let refreshToken: String | ||
|
||
public init(accessToken: String, refreshToken: String) { | ||
self.accessToken = accessToken | ||
self.refreshToken = refreshToken | ||
} | ||
} |
19 changes: 0 additions & 19 deletions
19
SOPT-iOS/Projects/Domain/Sources/RepositoryInterface/AuthRepositoryInterface.swift
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
SOPT-iOS/Projects/Domain/Sources/RepositoryInterface/CoreAuthRepositoryInterface.swift
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,17 @@ | ||
// | ||
// CoreAuthRepositoryInterface.swift | ||
// Domain | ||
// | ||
// Created by 장석우 on 12/20/24. | ||
// Copyright © 2024 SOPT-iOS. All rights reserved. | ||
// | ||
|
||
import Combine | ||
|
||
public protocol CoreAuthRepositoryInterface { | ||
func login(for provider: OAuthType,with identityToken: String) -> AnyPublisher<CoreAuthTokens, CoreAuthError> | ||
func changeSocialAccount() -> AnyPublisher<Void, CoreAuthError> | ||
func searchSocialAccount() -> AnyPublisher<Void, CoreAuthError> | ||
func signUp(_ model: SignUpModel) -> AnyPublisher<Void, CoreAuthError> | ||
func saveTokens(_ tokens: CoreAuthTokens) -> Void | ||
} |
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
Oops, something went wrong.