Add lead workflows, PDF signing, AR projects and photo gallery integration
This commit is contained in:
21
GasTankAR/Services/StubAuthenticationService.swift
Normal file
21
GasTankAR/Services/StubAuthenticationService.swift
Normal file
@ -0,0 +1,21 @@
|
||||
import Foundation
|
||||
|
||||
struct StubAuthenticationService: AuthenticationService {
|
||||
let simulatedError: LoginError?
|
||||
let delay: Duration
|
||||
|
||||
init(simulatedError: LoginError? = nil, delay: Duration = .milliseconds(600)) {
|
||||
self.simulatedError = simulatedError
|
||||
self.delay = delay
|
||||
}
|
||||
|
||||
func signIn(salesCode: String) async throws -> LoginSession {
|
||||
try await Task.sleep(for: delay)
|
||||
try Task.checkCancellation()
|
||||
if let simulatedError {
|
||||
throw simulatedError
|
||||
}
|
||||
// Demo employee until the authentication API supplies the profile.
|
||||
return LoginSession(salesCode: salesCode, displayName: "M. Krämer")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user