fixing bugs

This commit is contained in:
dante ruiz 2019-06-06 11:58:39 -07:00
parent 9835f16821
commit f7333e90d8
3 changed files with 3 additions and 4 deletions

View file

@ -7,7 +7,7 @@
- (void) confirmCredentials:(NSString*)username :(NSString*)password {
NSLog(@"web request started");
NSString *post = [NSString stringWithFormat:@"grant_type=password&username=%@&password=%@&scope=owner", username, password];
NSString *post = [NSString stringWithFormat:@"grant_type=password&username=%@&password=%@&scope=owner", username, [password stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet symbolCharacterSet]]];
NSData *postData = [post dataUsingEncoding:NSUTF8StringEncoding];
NSString *postLength = [NSString stringWithFormat:@"%ld", (unsigned long)[postData length]];
@ -18,7 +18,6 @@
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:postData];
//NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
NSURLSession* session = [NSURLSession sharedSession];
NSURLSessionDataTask* dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {

View file

@ -41,6 +41,7 @@
[fileManager moveItemAtURL:location toURL:destinationURL error:&error];
Launcher* sharedLauncher = [Launcher sharedLauncher];
[sharedLauncher setDownloadFilename:destinationFileName];
NSString* appPath = [sharedLauncher getAppPath];
NSString* downloadFileName = [sharedLauncher getDownloadFilename];

View file

@ -12,7 +12,7 @@ static NSString* const organizationURL = @"https://s3.amazonaws.com/hifi-public/
self.username = aUsername;
const char *cKey = LAUNCHER_HMAC_SECRET;
const char *cData = [aOrganization cStringUsingEncoding:NSASCIIStringEncoding];
const char *cData = [[aOrganization lowercaseString] cStringUsingEncoding:NSASCIIStringEncoding];
unsigned char cHMAC[CC_SHA256_DIGEST_LENGTH];
CCHmac(kCCHmacAlgSHA256, cKey, strlen(cKey), cData, strlen(cData), cHMAC);
NSData *HMACData = [NSData dataWithBytes:cHMAC length:sizeof(cHMAC)];
@ -33,7 +33,6 @@ static NSString* const organizationURL = @"https://s3.amazonaws.com/hifi-public/
[sharedLauncher setLoginErrorState: NONE];
return [sharedLauncher organizationRequestFinished:TRUE];
}
NSLog(@"FAAAAILLLLLLLEEEEEEEDDDDDD");
[sharedLauncher setLoginErrorState: ORGANIZATION];
return [sharedLauncher organizationRequestFinished:FALSE];
/*NSLog(@"URL: %@", [organizationURL stringByAppendingString:jsonFile]);