AuthenticationState

@frozen
public enum AuthenticationState : Codable, Equatable, CustomStringConvertible, CustomDebugStringConvertible

A value representing an authentication state.

After using the AuthenticationService.unauthenticate(queue:then:) method, the authentication always goes into the AuthenticationState.unauthenticated state.

After a successful authentication, the authentication always goes into the AuthenticationState.authenticated(details:) state.

After a failed authentication, the authentication state never changes. In particular, the AuthenticationState.authenticated(details:) state is preserved since the previous authentication is always valid.

When the connection to the back-end is lost, the authentication state is frozen, unless the AuthenticationService.unauthenticate(queue:then:) method is used.

Cases

Initializers

  • Declaration

    Swift

    public init(from decoder: Decoder) throws

Encodable Protocol

  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws

API

  • The details of the user currently authenticated.

    This property is nil when there is currently no valid authentication token. i.e. when this value does not match the .authenticated(details:) case.

    Declaration

    Swift

    public var details: AuthenticationDetails? { get }

CustomStringConvertible Protocol

  • Declaration

    Swift

    public var description: String { get }

CustomDebugStringConvertible Protocol

  • Declaration

    Swift

    public var debugDescription: String { get }