-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathStytchClient.Sessions.attest+AsyncVariants.generated.swift
More file actions
37 lines (35 loc) · 1.65 KB
/
StytchClient.Sessions.attest+AsyncVariants.generated.swift
File metadata and controls
37 lines (35 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Generated using Sourcery 2.0.2 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT
import Combine
import Foundation
public extension StytchClient.Sessions {
/// Exchange an auth token issued by a trusted identity provider for a Stytch session.
/// You must first register a Trusted Auth Token profile in the Stytch dashboard (https://stytch.com/dashboard/trusted-auth-tokens).
/// If a session token or session JWT is provided, it will add the trusted auth token as an authentication factor to the existing session.
func attest(parameters: AttestParameters, completion: @escaping Completion<AuthenticateResponse>) {
Task {
do {
completion(.success(try await attest(parameters: parameters)))
} catch {
completion(.failure(error))
}
}
}
/// Exchange an auth token issued by a trusted identity provider for a Stytch session.
/// You must first register a Trusted Auth Token profile in the Stytch dashboard (https://stytch.com/dashboard/trusted-auth-tokens).
/// If a session token or session JWT is provided, it will add the trusted auth token as an authentication factor to the existing session.
func attest(parameters: AttestParameters) -> AnyPublisher<AuthenticateResponse, Error> {
return Deferred {
Future({ promise in
Task {
do {
promise(.success(try await attest(parameters: parameters)))
} catch {
promise(.failure(error))
}
}
})
}
.eraseToAnyPublisher()
}
}