Login

public struct Login: Decodable

A successful authentication result.

  • Token to be used for further login requests.

    Declaration

    Swift

    public let token: String
  • Authenticate via login/password combination.

    Declaration

    Swift

    public static func authenticate(withLogin login: String,
                                        andPassword password: String,
                                        session: URLSession = .shared,
                                        completion: @escaping (Result<Login>) -> Void)

    Parameters

    login

    ZIH login, e.g. s1234567

    password

    password

    session

    session to use, defaults to .shared

    completion

    handler

  • Authenticate via a previously saved token.

    Declaration

    Swift

    public static func authenticate(withToken token: String,
                                        session: URLSession = .shared,
                                        completion: @escaping (Result<Login>) -> Void)

    Parameters

    token

    token

    session

    session to use, defaults to .shared

    completion

    handler