-
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.
- Loading branch information
1 parent
8cc54c4
commit 608bfea
Showing
17 changed files
with
164 additions
and
36 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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// SignInExt.swift | ||
// Data | ||
// | ||
// Created by hhhello0507 on 10/4/24. | ||
// | ||
|
||
import Foundation | ||
import SignKit | ||
|
||
public extension Sign { | ||
static var me: Sign { | ||
Sign(store: .init(.graduating)) | ||
} | ||
} |
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
37 changes: 37 additions & 0 deletions
37
Graduating-iOS/Graduating/Feature/Main/Profile/ProfileObservable.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,37 @@ | ||
// | ||
// ProfileViewModel.swift | ||
// Graduating | ||
// | ||
// Created by hhhello0507 on 10/4/24. | ||
// | ||
|
||
import Combine | ||
import Model | ||
import Data | ||
import Foundation | ||
import SignKit | ||
|
||
final class ProfileObservable: ObservableObject { | ||
enum Subject { | ||
case signInFailure | ||
} | ||
var subscription = Set<AnyCancellable>() | ||
var subject = PassthroughSubject<Subject, Never>() | ||
func signIn(code: String, platformType: PlatformType) { | ||
AuthService.shared.oauth2SignIn( | ||
.init(platformType: platformType, code: code) | ||
) | ||
.sink { | ||
print($0) | ||
} receiveValue: { | ||
Sign.me.login(id: "", password: "", accessToken: $0.accessToken, refreshToken: $0.refreshToken) | ||
} | ||
.store(in: &subscription) | ||
} | ||
|
||
deinit { | ||
subscription.forEach { | ||
$0.cancel() | ||
} | ||
} | ||
} |
Oops, something went wrong.