Commit 554abcb1 by Brent Gulanowski

Pass the customer access token to callbacks after login and renew.

parent 1cc02e5b
......@@ -55,7 +55,7 @@ typedef void (^BUYDataCustomerTokenBlock)(BUYCustomer * _Nullable customer, BUYC
* @param token An authentication token to retrieve the customer later. Store this token securely on the device.
* @param error An optional NSError
*/
typedef void (^BUYDataTokenBlock)(NSString * _Nullable token, NSError * _Nullable error);
typedef void (^BUYDataTokenBlock)(BUYCustomerToken * _Nullable token, NSError * _Nullable error);
/**
* Return block containing an array of BUYOrders
......
......@@ -118,13 +118,12 @@
NSURL *url = [self urlForCustomersTokenRenewal];
return [self putRequestForURL:url object:nil completionHandler:^(NSDictionary *json, NSHTTPURLResponse *response, NSError *error) {
NSString *accessToken = nil;
BUYCustomerToken *customerToken = nil;
if (json && !error) {
BUYCustomerToken *customerToken = [BUYCustomerToken customerTokenWithJSON:json];
accessToken = customerToken.accessToken;
customerToken = [BUYCustomerToken customerTokenWithJSONDictionary:json];
}
block(accessToken, error);
block(customerToken, error);
}];
}
else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment