-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SDK-1473: Add B2B member session exchange func
- Loading branch information
1 parent
133396d
commit d450152
Showing
11 changed files
with
156 additions
and
47 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
Sources/StytchCore/Generated/Sessions.exchnage+AsyncVariants.generated.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 @@ | ||
// Generated using Sourcery 2.0.2 — https://github.com/krzysztofzablocki/Sourcery | ||
// DO NOT EDIT | ||
import Combine | ||
import Foundation | ||
|
||
public extension Sessions { | ||
/// Use this endpoint to exchange a Member's existing session for another session in a different Organization. | ||
func exchnage(parameters: ExchangeParameters, completion: @escaping Completion<B2BAuthenticateResponse>) { | ||
Task { | ||
do { | ||
completion(.success(try await exchnage(parameters: parameters))) | ||
} catch { | ||
completion(.failure(error)) | ||
} | ||
} | ||
} | ||
|
||
/// Use this endpoint to exchange a Member's existing session for another session in a different Organization. | ||
func exchnage(parameters: ExchangeParameters) -> AnyPublisher<B2BAuthenticateResponse, Error> { | ||
return Deferred { | ||
Future({ promise in | ||
Task { | ||
do { | ||
promise(.success(try await exchnage(parameters: parameters))) | ||
} catch { | ||
promise(.failure(error)) | ||
} | ||
} | ||
}) | ||
} | ||
.eraseToAnyPublisher() | ||
} | ||
} |
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
1 change: 1 addition & 0 deletions
1
Sources/StytchCore/StytchClientCommon/Sessions/SessionsRoute.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
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