|
|
|
|
@ -59,6 +59,7 @@ public class Services { |
|
|
|
|
self.keychainStore = KeychainStore(serverId: url) |
|
|
|
|
// self._storeIdentifier = storeId |
|
|
|
|
Logger.log("create keystore with id: \(url)") |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// The base API URL to send requests |
|
|
|
|
@ -340,8 +341,8 @@ public class Services { |
|
|
|
|
/// - username: the account's username |
|
|
|
|
/// - password: the account's password |
|
|
|
|
public func logout() async throws { |
|
|
|
|
let logoutRequest = try self._baseRequest(conf: .logout) |
|
|
|
|
let _: Empty = try await self._runRequest(logoutRequest) |
|
|
|
|
let deviceId: String = StoreCenter.main.deviceId() |
|
|
|
|
let _: Empty = try await self._runRequest(serviceConf: .logout, payload: Logout(deviceId: deviceId)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// A login method that actually requests a token from the server, and stores the appropriate data for later usage |
|
|
|
|
@ -456,6 +457,9 @@ struct Email: Codable { |
|
|
|
|
} |
|
|
|
|
struct Empty: Codable { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
struct Logout: Codable { |
|
|
|
|
var deviceId: String |
|
|
|
|
} |
|
|
|
|
struct DeviceToken: Codable { |
|
|
|
|
var value: String |
|
|
|
|
|