diff --git a/Sources/NetworkApi/Interfaces/BaseNetworkService.swift b/Sources/NetworkApi/Interfaces/BaseNetworkService.swift index 6d67907..38e0da8 100644 --- a/Sources/NetworkApi/Interfaces/BaseNetworkService.swift +++ b/Sources/NetworkApi/Interfaces/BaseNetworkService.swift @@ -8,6 +8,8 @@ public final class BaseNetworkService: BaseNetworkServiceProtocol { public var baseURL: String? + public init() {} + public func execute(path: String, method: HTTPMethod, headers: HTTPHeaders, parameters: Parameters) async throws -> Data { guard let baseURL = baseURL else { fatalError("Error baseURL") diff --git a/Sources/NetworkApi/NetworkLayer/Auth/NetworkAuth.swift b/Sources/NetworkApi/NetworkLayer/Auth/NetworkAuth.swift index e3d022e..3c8eea7 100644 --- a/Sources/NetworkApi/NetworkLayer/Auth/NetworkAuth.swift +++ b/Sources/NetworkApi/NetworkLayer/Auth/NetworkAuth.swift @@ -11,10 +11,11 @@ public final class NetworkUser: NetworkUserProtocol { let baseUrl: BaseNetworkServiceProtocol - init(baseUrl: BaseNetworkServiceProtocol) { + public init(baseUrl: BaseNetworkServiceProtocol) { self.baseUrl = baseUrl } + public func login(identity: String, password: String) async throws -> ServerResponseAuth { let data = try await baseUrl.execute(path: URLS.login, method: .post, headers: Headers.headers(), parameters: [ "identity": identity,