Skip to content

Commit

Permalink
fixed crash on menu and edge case with both web and username password…
Browse files Browse the repository at this point in the history
… views showing
  • Loading branch information
twocanoes committed Feb 26, 2024
1 parent 009d1bf commit d6a1b17
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 61 deletions.
4 changes: 2 additions & 2 deletions Profile Manifest/com.twocanoes.xcreds.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<key>pfm_app_url</key>
<string>https://github.com/twocanoes/xcreds</string>
<key>pfm_description</key>
<string>XCreds 4.1 (6364) OAuth Settings</string>
<string>XCreds 4.1 (6374) OAuth Settings</string>
<key>pfm_documentation_url</key>
<string>https://twocanoes.com/knowledge-base/xcreds-admin-guide/#preferences</string>
<key>pfm_domain</key>
<string>com.twocanoes.xcreds</string>
<key>pfm_format_version</key>
<integer>1</integer>
<key>pfm_last_modified</key>
<date>2024-02-23T17:44:54Z</date>
<date>2024-02-24T15:30:20Z</date>
<key>pfm_platforms</key>
<array>
<string>macOS</string>
Expand Down
16 changes: 12 additions & 4 deletions XCreds/MainController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ class MainController: NSObject, UpdateCredentialsFeedbackProtocol {
return
}


if let webViewController = windowController.webViewController{
webViewController.webView.isHidden=true
}
scheduleManager.setNextCheckTime()

var forceUsernamePassword = false
Expand All @@ -93,12 +97,16 @@ class MainController: NSObject, UpdateCredentialsFeedbackProtocol {
}
}
if forceUsernamePassword == false && (DefaultsOverride.standardOverride.value(forKey: PrefKeys.discoveryURL.rawValue) != nil && DefaultsOverride.standardOverride.value(forKey: PrefKeys.clientID.rawValue) != nil) {
windowController.webViewController.webView.isHidden=false

windowController.webViewController.updateCredentialsFeedbackDelegate=self
windowController.window!.makeKeyAndOrderFront(self)

if let webViewController = windowController.webViewController{
webViewController.webView.isHidden=false

windowController.webViewController.updateCredentialsFeedbackDelegate=self
windowController.webViewController?.loadPage()
}
NSApp.activate(ignoringOtherApps: true)
windowController.webViewController?.loadPage()

}

else if (DefaultsOverride.standardOverride.bool(forKey: PrefKeys.shouldUseROPGForMenuLogin.rawValue) == true || DefaultsOverride.standardOverride.value(forKey: PrefKeys.aDDomain.rawValue) != nil )
Expand Down
12 changes: 6 additions & 6 deletions xCreds.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6373;
CURRENT_PROJECT_VERSION = 6374;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1477,7 +1477,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6373;
CURRENT_PROJECT_VERSION = 6374;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1598,7 +1598,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6373;
CURRENT_PROJECT_VERSION = 6374;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1635,7 +1635,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6373;
CURRENT_PROJECT_VERSION = 6374;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1785,7 +1785,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6373;
CURRENT_PROJECT_VERSION = 6374;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1827,7 +1827,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6373;
CURRENT_PROJECT_VERSION = 6374;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "BC9E7DA1-86EE-490B-8500-00D128301048"
uuid = "DC394CD4-8292-4035-A700-875673E50955"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "XCreds/MainController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "109"
endingLineNumber = "109"
startingLineNumber = "102"
endingLineNumber = "102"
landmarkName = "showSignInWindow(force:forceLoginWindowType:)"
landmarkType = "7">
<Locations>
<Location
uuid = "BC9E7DA1-86EE-490B-8500-00D128301048 - 87193356e955dc28"
uuid = "DC394CD4-8292-4035-A700-875673E50955 - 87193356e955dcf2"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
Expand All @@ -30,12 +30,12 @@
urlString = "file:///Users/tperfitt/Documents/Projects/xcreds/XCreds/MainController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "109"
endingLineNumber = "109"
offsetFromSymbolStart = "3300">
startingLineNumber = "103"
endingLineNumber = "103"
offsetFromSymbolStart = "1428">
</Location>
<Location
uuid = "BC9E7DA1-86EE-490B-8500-00D128301048 - 87193356e955ddc9"
uuid = "DC394CD4-8292-4035-A700-875673E50955 - 87193356e955dcd1"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
Expand All @@ -45,12 +45,12 @@
urlString = "file:///Users/tperfitt/Documents/Projects/xcreds/XCreds/MainController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "110"
endingLineNumber = "110"
offsetFromSymbolStart = "3148">
startingLineNumber = "102"
endingLineNumber = "102"
offsetFromSymbolStart = "1368">
</Location>
<Location
uuid = "BC9E7DA1-86EE-490B-8500-00D128301048 - 87193356e955ddc9"
uuid = "DC394CD4-8292-4035-A700-875673E50955 - 87193356e955dcd1"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
Expand All @@ -60,44 +60,12 @@
urlString = "file:///Users/tperfitt/Documents/Projects/xcreds/XCreds/MainController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "110"
endingLineNumber = "110"
offsetFromSymbolStart = "3124">
startingLineNumber = "102"
endingLineNumber = "102"
offsetFromSymbolStart = "1676">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "2E96ACA4-5120-4CE0-8BAD-7EE496D3C80D"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "XCreds/MainController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "106"
endingLineNumber = "106"
landmarkName = "showSignInWindow(force:forceLoginWindowType:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "B2CA9F02-42F2-47A9-AA15-1D3D816E5AE8"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "NoMADSession.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "1184"
endingLineNumber = "1184"
landmarkName = "authenticate(authTestOnly:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<key>auth_mech_fixup.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>6</integer>
<integer>7</integer>
</dict>
<key>authrights.xcscheme_^#shared#^_</key>
<dict>
Expand All @@ -42,7 +42,7 @@
<key>test.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>7</integer>
<integer>6</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
Expand Down

0 comments on commit d6a1b17

Please sign in to comment.