Skip to content
This repository has been archived by the owner on Jan 28, 2019. It is now read-only.

Commit

Permalink
Merge pull request #11 from khakionion/AuthTestClosure
Browse files Browse the repository at this point in the history
Provide the user/team IDs when handling authTest success
  • Loading branch information
pvzig committed Feb 19, 2018
2 parents 1e44cd0 + 76a2bd1 commit 6344d39
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Sources/WebAPI.swift
Expand Up @@ -35,6 +35,7 @@ public final class WebAPI {
public typealias HistoryClosure = (_ history: History) -> Void
public typealias FileClosure = (_ file: File) -> Void
public typealias ItemsClosure = (_ items: [Item]?) -> Void
public typealias AuthTestClosure = (_ user: String?, _ team: String?) -> Void

public enum InfoType: String {
case purpose, topic
Expand Down Expand Up @@ -115,9 +116,9 @@ extension WebAPI {

// MARK: - Auth
extension WebAPI {
public func authenticationTest(success: SuccessClosure?, failure: FailureClosure?) {
networkInterface.request(.authTest, parameters: ["token": token], successClosure: { _ in
success?(true)
public func authenticationTest(success: AuthTestClosure?, failure: FailureClosure?) {
networkInterface.request(.authTest, parameters: ["token": token], successClosure: { (response) in
success?(response["user_id"] as? String, response["team_id"] as? String)
}) {(error) in
failure?(error)
}
Expand Down

0 comments on commit 6344d39

Please sign in to comment.