making requested changes

This commit is contained in:
dante ruiz 2019-06-28 15:37:21 -07:00
parent 6a5c9097c9
commit 12477f3df1
4 changed files with 21 additions and 12 deletions

View file

@ -74,8 +74,8 @@
<autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="By signing in, you agree to the High Fidelity" id="zSf-YA-osu">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="textColor" name="alternateSelectedControlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="alternateSelectedControlTextColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xeX-qc-ccB" customClass="HFButton">

View file

@ -40,8 +40,8 @@
<autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="We seem to have a problem." id="bX3-v1-LLM">
<font key="font" metaFont="system" size="15"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="textColor" name="alternateSelectedControlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="alternateSelectedControlTextColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="tV0-Su-eLX">
@ -49,8 +49,8 @@
<autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="Please restart Launcher" id="aBw-o2-xZE">
<font key="font" metaFont="system" size="15"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="textColor" name="alternateSelectedControlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="alternateSelectedControlTextColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Sds-MZ-qhT" customClass="HFButton">

View file

@ -26,7 +26,7 @@
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:postData];
NSURLSession * session = [NSURLSession sessionWithConfiguration:NSURLSessionConfiguration.ephemeralSessionConfiguration delegate: self delegateQueue: [NSOperationQueue mainQueue]];
NSURLSession* session = [NSURLSession sessionWithConfiguration:NSURLSessionConfiguration.ephemeralSessionConfiguration delegate: self delegateQueue: [NSOperationQueue mainQueue]];
NSURLSessionDataTask* dataTask = [session dataTaskWithRequest:request];
[dataTask resume];
@ -60,12 +60,13 @@
} else {
if (self.statusCode == 200) {
NSString* jsonString = [[NSString alloc] initWithBytes: [self.receivedData mutableBytes] length:[self.receivedData length] encoding:NSUTF8StringEncoding];
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
NSData* jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
NSError* jsonError = nil;
id json = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:&jsonError];
if (jsonError) {
NSLog(@"Credentials: Failed to parse json -> error: %@", jsonError);
NSLog(@"Credentials: JSON string from data: %@", jsonString);
[sharedLauncher displayErrorPage];
return;
}

View file

@ -73,10 +73,18 @@ static NSString* const organizationURL = @"https://orgs.highfidelity.com/organiz
[sharedLauncher displayErrorPage];
return;
}
NSLog(@"Organization: getting org file successful");
[sharedLauncher setDomainURLInfo:[json valueForKey:@"domain"] :[json valueForKey:@"content_set_url"] :[json valueForKey:@"scripts_url"]];
[sharedLauncher setLoginErrorState: NONE];
[sharedLauncher organizationRequestFinished:TRUE];
NSString* domainURL = [json valueForKey:@"domain"];
NSString* contentSetURL = [json valueForKey:@"content_set_url"];
if (domainURL != nil && contentSetURL != nil) {
NSLog(@"Organization: getting org file successful");
[sharedLauncher setDomainURLInfo:[json valueForKey:@"domain"] :[json valueForKey:@"content_set_url"] :nil];
[sharedLauncher setLoginErrorState: NONE];
[sharedLauncher organizationRequestFinished:TRUE];
} else {
NSLog(@"Organization: Either domainURL: %@ or contentSetURL: %@ json entries are invalid", domainURL, contentSetURL);
[sharedLauncher displayErrorPage];
}
} else if (self.statusCode == 403 || self.statusCode == 404) {
NSLog(@"Organization: failed to get org file");
[sharedLauncher setLoginErrorState: ORGANIZATION];