This commit is contained in:
Aakiyaru 2025-05-27 15:16:57 +07:00
parent fe8f570fd0
commit b12622219a
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@
import Foundation import Foundation
struct ServerResponseIdToken: Decodable { struct ServerResponseIdToken: Decodable {
public let items: IdToken public let items: [IdToken]
public struct IdToken: Decodable { public struct IdToken: Decodable {
public let id: String public let id: String

View File

@ -55,7 +55,7 @@ public final class NetworkUser: NetworkUserProtocol {
public func getIdToken(token: String) async throws -> String { public func getIdToken(token: String) async throws -> String {
let data = try await baseUrl.execute(path: URLS.getIdToken, method: .get, headers: Headers.headerWithToken(token: token), parameters: nil) let data = try await baseUrl.execute(path: URLS.getIdToken, method: .get, headers: Headers.headerWithToken(token: token), parameters: nil)
let tokenID = try JSONDecoder().decode(ServerResponseIdToken.self, from: data) let tokenID = try JSONDecoder().decode(ServerResponseIdToken.self, from: data)
return tokenID.items.id return tokenID.items.first!.id
} }
public func deleteUser(idToken: String, token: String) async throws { public func deleteUser(idToken: String, token: String) async throws {