Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Foundation
- import Alamofire
- import NeedleFoundation
- class AuthHttpService: Component<EmptyDependency>, AuthHttpServiceProtocol {
- func getDeviceId() async -> Result<Array<DeviceId>, NetworkError> {
- return await AF.requestPayload(
- path: "/device",
- method: .get,
- headers: [.authorization("Basic 647863724389778:n'?+%)h\"vBd?UH%A?*TSuqe`H@pKXB[")]
- )
- }
- func getAccessToken(tokenRequest: TokenRequestProtocol) async -> Result<Array<Token>, NetworkError> {
- return await AF.requestPayload(
- path: "/token/store",
- method: .post,
- parameters: ["password": "123123Q", "deviceId": "8fdfa049-2976-4c66-af99-eddfda4f7788", "username": "RU#71231231234"],
- headers: [.authorization("Basic 647863724389778:n'?+%)h\"vBd?UH%A?*TSuqe`H@pKXB[")]
- )
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement