xtool.git
Publicgit clone https://git.maproj.org/xtool.gitxtool.git / Sources / XKit / GrandSlam / Requests / Concrete / GrandSlamTrustedDeviceRequest.swift
GrandSlamTrustedDeviceRequest.swift50 lines · 1.3 KiBRaw
| 1 | // |
| 2 | // GrandSlamTrustedDeviceRequest.swift |
| 3 | // XKit |
| 4 | // |
| 5 | // Created by Kabir Oberai on 20/11/19. |
| 6 | // Copyright © 2019 Kabir Oberai. All rights reserved. |
| 7 | // |
| 8 | |
| 9 | import Foundation |
| 10 | |
| 11 | struct GrandSlamTrustedDeviceRequest: GrandSlamTwoFactorRequest { |
| 12 | struct Decoder: GrandSlamDataDecoder { |
| 13 | static func decode(data: Data) throws {} |
| 14 | } |
| 15 | |
| 16 | static let endpoint: GrandSlamEndpoint = .lookup(\.trustedDeviceSecondaryAuth) |
| 17 | |
| 18 | let loginData: GrandSlamLoginData |
| 19 | } |
| 20 | |
| 21 | struct GrandSlamSecondaryAuthRequest: GrandSlamTwoFactorRequest { |
| 22 | struct Decoder: GrandSlamDataDecoder { |
| 23 | static func decode(data: Data) throws { |
| 24 | // print(String(data: data, encoding: .utf8) ?? "NO DATA") |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | static let endpoint: GrandSlamEndpoint = .lookup(\.secondaryAuth) |
| 29 | |
| 30 | let loginData: GrandSlamLoginData |
| 31 | } |
| 32 | |
| 33 | struct GrandSlamSMSAuthRequest: GrandSlamTwoFactorRequest { |
| 34 | struct Decoder: GrandSlamDataDecoder { |
| 35 | static func decode(data: Data) throws {} |
| 36 | } |
| 37 | |
| 38 | static let endpoint: GrandSlamEndpoint = .url(URL(string: "https://gsa.apple.com/auth/verify/phone/put?mode=sms")!) |
| 39 | |
| 40 | let loginData: GrandSlamLoginData |
| 41 | let phoneNumberID: String |
| 42 | |
| 43 | func method(anisetteData: AnisetteData) -> GrandSlamMethod { |
| 44 | .post([ |
| 45 | "serverInfo": [ |
| 46 | "phoneNumber.id": phoneNumberID |
| 47 | ], |
| 48 | ]) |
| 49 | } |
| 50 | } |