Journey
public extension Journey
-
Creates a Journey instance with sensible defaults and optional customization.
This configures:
- Logging and timeout
- Default headers via
CustomHeader.config - Node transformation, session management, and OIDC support modules
Callback registrations for common Journey callbacks
Declaration
Swift
static func createJourney(block: @Sendable (JourneyConfig) -> Void = {_ in }) -> JourneyParameters
blockAn optional configuration closure to customize
JourneyConfigand modules.Return Value
A configured Journey.
-
start(_:Asynchronousconfigure: ) Starts a Journey by name with optional options configuration.
Declaration
Swift
func start(_ journeyName: String, configure: @Sendable (inout Options) -> Void = { _ in }) async -> NodeParameters
journeyNameThe name of the Journey (auth tree) to start.
configureOptional closure to modify
Optionsbefore starting.Return Value
The first
Nodereturned by the Journey start. -
resume(_:Asynchronousconfigure: ) Resumes a Journey from a suspended URI with optional options configuration.
Declaration
Swift
func resume(_ uri: URL, configure: @Sendable (inout Options) -> Void = { _ in }) async -> NodeParameters
uriThe resume URI containing the suspendedId parameter.
configureOptional closure to modify
Optionsbefore resuming.Return Value
The next
Nodereturned by the Journey resume, or aFailureNodeif URI is invalid. -
journeySignOff()AsynchronousSigns off the Journey session and performs any configured cleanup.
Declaration
Swift
func journeySignOff() async -> Result<Void, Error>Return Value
.success(())on success or.failure(Error)if sign-off fails. -
journeyUser()AsynchronousReturns the current authenticated user for this Journey, if available.
This will:
- Initialize the Journey if needed
- Return a cached user if present
If a session exists, prepare and cache a
UserDelegatebacked byOidcUser
Declaration
Swift
public func journeyUser() async -> User?Return Value
A
Userif available, otherwisenil.
View on GitHub