Skip to content

Commit d68e9f4

Browse files
committedOct 23, 2013
Merge pull request AFNetworking#33 from tnwinc/master
Allow `setAuthorizationHeaderWithUsername` to work when called before getting OAuth credentials.
2 parents ff106e1 + a3e911e commit d68e9f4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎AFOAuth2Client/AFOAuth2Client.m

+1-2
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,6 @@ - (void)authenticateUsingOAuthWithPath:(NSString *)path
167167
[mutableParameters setValue:self.secret forKey:@"client_secret"];
168168
parameters = [NSDictionary dictionaryWithDictionary:mutableParameters];
169169

170-
[self clearAuthorizationHeader];
171-
172170
NSMutableURLRequest *mutableRequest = [self requestWithMethod:@"POST" path:path parameters:parameters];
173171
[mutableRequest setValue:@"application/json" forHTTPHeaderField:@"Accept"];
174172

@@ -198,6 +196,7 @@ - (void)authenticateUsingOAuthWithPath:(NSString *)path
198196

199197
[credential setRefreshToken:refreshToken expiration:expireDate];
200198

199+
[self clearAuthorizationHeader];
201200
[self setAuthorizationHeaderWithCredential:credential];
202201

203202
if (success) {

0 commit comments

Comments
 (0)
Please sign in to comment.