Skip to content

Commit

Permalink
fixed issue with menu item not updating tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
twocanoes committed Jan 31, 2024
1 parent af102f9 commit 7661fc2
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 23 deletions.
2 changes: 1 addition & 1 deletion XCreds/LoginWebViewController.xib
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<window title="Sign In" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" titleVisibility="hidden" id="KxT-zM-Vnn" customClass="LoginWindow" customModule="XCredsLoginPlugin">
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="453" y="250" width="1002" height="883"/>
<rect key="screenRect" x="0.0" y="0.0" width="1496" height="910"/>
<rect key="screenRect" x="0.0" y="0.0" width="3440" height="1415"/>
<view key="contentView" wantsLayer="YES" id="2LH-tE-efn">
<rect key="frame" x="0.0" y="0.0" width="1002" height="883"/>
<autoresizingMask key="autoresizingMask"/>
Expand Down
12 changes: 6 additions & 6 deletions XCreds/MainController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import Cocoa
import OIDCLite
class MainController: NSObject, UpdateCredentialsFeedbackProtocol {




var passwordCheckTimer:Timer?
var feedbackDelegate:TokenManagerFeedbackDelegate?

Expand Down Expand Up @@ -202,6 +199,7 @@ class MainController: NSObject, UpdateCredentialsFeedbackProtocol {

DispatchQueue.main.async {
self.windowController.window?.close()

let localAccountAndPassword = self.localAccountAndPassword()
if credentials.password != nil, let localPassword=localAccountAndPassword.1{
if localPassword != credentials.password{
Expand Down Expand Up @@ -244,14 +242,16 @@ class MainController: NSObject, UpdateCredentialsFeedbackProtocol {
if updatePassword {
if let cloudPassword = credentials.password {
try? PasswordUtils.changeLocalUserAndKeychainPassword(localPassword, newPassword: cloudPassword)
if TokenManager.saveTokensToKeychain(creds: credentials, setACL: true, password:cloudPassword ) == false {
TCSLogErrorWithMark("error saving tokens to keychain")
}

}
}
}

}
if TokenManager.saveTokensToKeychain(creds: credentials, setACL: true, password:credentials.password ) == false {
TCSLogErrorWithMark("error saving tokens to keychain")
}

self.scheduleManager.startCredentialCheck()

}
Expand Down
12 changes: 6 additions & 6 deletions xCreds.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6274;
CURRENT_PROJECT_VERSION = 6275;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1473,7 +1473,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6274;
CURRENT_PROJECT_VERSION = 6275;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1594,7 +1594,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6274;
CURRENT_PROJECT_VERSION = 6275;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1631,7 +1631,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6274;
CURRENT_PROJECT_VERSION = 6275;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1781,7 +1781,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6274;
CURRENT_PROJECT_VERSION = 6275;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1823,7 +1823,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6274;
CURRENT_PROJECT_VERSION = 6275;
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 @@ -119,32 +119,48 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "1E6D2E04-8828-450B-B126-B234500FF5F9"
uuid = "6C3BB5C8-F87C-4280-A376-6FF3005B8236"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "XCreds/TokenManager.swift"
filePath = "XCreds/StatusMenuController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "70"
endingLineNumber = "70"
landmarkName = "oidc()"
startingLineNumber = "108"
endingLineNumber = "108"
landmarkName = "validateMenuItem(_:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "6C3BB5C8-F87C-4280-A376-6FF3005B8236"
uuid = "D4D41778-258D-42CF-A91F-1FEC9F0DC853"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "XCreds/StatusMenuController.swift"
filePath = "XCreds/MainController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "108"
endingLineNumber = "108"
landmarkName = "validateMenuItem(_:)"
startingLineNumber = "196"
endingLineNumber = "196"
landmarkName = "credentialsUpdated(_:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "5211E3D8-D374-4A48-8C36-5527D1983FF1"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "XCreds/MainController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "201"
endingLineNumber = "201"
landmarkName = "credentialsUpdated(_:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
Expand Down

0 comments on commit 7661fc2

Please sign in to comment.