auth
This commit is contained in:
parent
e3ea9b9fcb
commit
47580e8290
@ -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")
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user