/// - Parameter completion: NodeCompletion callback which returns the result of Node submission.
public func next<T>(completion:@escaping NodeCompletion<T>) {
if T.self as AnyObject? === Token.self {
next { (token: Token?, node, error) in
completion(token as? T, node, error)
}
}
else if T.self as AnyObject? === AccessToken.self {
next { (token: AccessToken?, node, error) in
completion(token as? T, node, error)
}
}
else if T.self as AnyObject? === FRUser.self {
next { (user: FRUser?, node, error) in
completion(user as? T, node, error)
}
}
else {
completion(nil, nil, AuthError.invalidGenericType)
}
}