Skip to content

Commit

Permalink
Add function to get session without refreshing it
Browse files Browse the repository at this point in the history
  • Loading branch information
leoMehlig committed Apr 22, 2024
1 parent 41a2ca6 commit 4293cca
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Sources/Auth/AuthClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ public final class AuthClient: @unchecked Sendable {
}
}

/// Returns the session.
///
/// - Parameters:
/// - shouldValidateExpiration: If the session should be refresh, if necessary.
///
/// If no session can be found, a ``AuthError/sessionNotFound`` error is thrown.
public func session(shouldValidateExpiration: Bool = true) async throws -> Session {
try await sessionManager.session(shouldValidateExpiration: shouldValidateExpiration)
}

/// Namespace for accessing multi-factor authentication API.
public let mfa: AuthMFA

Expand Down

0 comments on commit 4293cca

Please sign in to comment.