Skip to content

Commit

Permalink
tweaked text for user space refresh token window and added pref to sh…
Browse files Browse the repository at this point in the history
…ow or hide
  • Loading branch information
twocanoes committed Feb 24, 2023
1 parent cd482e6 commit 9f29893
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 23 deletions.
15 changes: 14 additions & 1 deletion Profile Manifest/com.twocanoes.xcreds.plist
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ A profile can consist of payloads with different version numbers. For example, c
<key>pfm_type</key>
<string>integer</string>
</dict>

<dict>
<key>pfm_default</key>
<string>Cloud Login</string>
Expand Down Expand Up @@ -416,6 +415,20 @@ A profile can consist of payloads with different version numbers. For example, c
<key>pfm_type</key>
<string>boolean</string>
</dict>
<dict>
<key>pfm_default</key>
<true/>
<key>pfm_description</key>
<string>Show text at the top of the prompt window when tokens expire.</string>
<key>pfm_documentation_url</key>
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#shouldshowrefreshbanner</string>
<key>pfm_name</key>
<string>shouldShowRefreshBanner</string>
<key>pfm_title</key>
<string>Show Refresh Banner</string>
<key>pfm_type</key>
<string>boolean</string>
</dict>
<dict>
<key>pfm_default</key>
<true/>
Expand Down
2 changes: 1 addition & 1 deletion XCreds/PrefKeys.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation

enum PrefKeys: String {
case clientID, clientSecret, password="local password",discoveryURL, redirectURI, scopes, accessToken, idToken, refreshToken, tokenEndpoint, expirationDate, invalidToken, refreshRateHours, showDebug, verifyPassword, shouldShowQuitMenu, shouldShowPreferencesOnStart, shouldSetGoogleAccessTypeToOffline, passwordChangeURL, shouldShowAboutMenu, username, idpHostName, passwordElementID, shouldShowVersionInfo, shouldShowSupportStatus,shouldShowConfigureWifiButton,shouldShowMacLoginButton, loginWindowBackgroundImageURL, shouldShowCloudLoginByDefault,idpHostNames,autoRefreshLoginTimer, loginWindowWidth, loginWindowHeight
case clientID, clientSecret, password="local password",discoveryURL, redirectURI, scopes, accessToken, idToken, refreshToken, tokenEndpoint, expirationDate, invalidToken, refreshRateHours, showDebug, verifyPassword, shouldShowQuitMenu, shouldShowPreferencesOnStart, shouldSetGoogleAccessTypeToOffline, passwordChangeURL, shouldShowAboutMenu, username, idpHostName, passwordElementID, shouldShowVersionInfo, shouldShowSupportStatus,shouldShowConfigureWifiButton,shouldShowMacLoginButton, loginWindowBackgroundImageURL, shouldShowCloudLoginByDefault,idpHostNames,autoRefreshLoginTimer, loginWindowWidth, loginWindowHeight, shouldShowRefreshBanner
}
func getManagedPreference(key: Preferences) -> Any? {

Expand Down
3 changes: 3 additions & 0 deletions XCreds/WebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ class WebViewController: NSWindowController {
return NSNib.Name("WebView")
}

@IBOutlet weak var refreshTitleTextField: NSTextField!
@IBOutlet weak var backgroundImageView: NSImageView!
@IBOutlet weak var webView: WKWebView!
@IBOutlet weak var cancelButton: NSButton!

var password:String?
func loadPage() {

refreshTitleTextField.isHidden = !UserDefaults.standard.bool(forKey: PrefKeys.shouldShowRefreshBanner.rawValue)

webView.navigationDelegate = self
TokenManager.shared.oidc().delegate = self
clearCookies()
Expand Down
31 changes: 18 additions & 13 deletions XCreds/WebView.xib
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,24 @@
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="WebViewController" customModule="XCreds" customModuleProvider="target">
<connections>
<outlet property="refreshTitleTextField" destination="YnV-QC-aTR" id="X1r-3u-usj"/>
<outlet property="webView" destination="p1x-1L-05D" id="hJN-Xq-dh8"/>
<outlet property="window" destination="KxT-zM-Vnn" id="v4i-bY-4eE"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window title="Sign In" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="KxT-zM-Vnn" customClass="LoginWindow" customModule="XCreds" customModuleProvider="target">
<window title="XCreds Cloud Refresh" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="KxT-zM-Vnn" customClass="LoginWindow" customModule="XCreds" customModuleProvider="target">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="453" y="250" width="628" height="613"/>
<rect key="screenRect" x="0.0" y="0.0" width="1728" height="1079"/>
<rect key="screenRect" x="0.0" y="0.0" width="2048" height="833"/>
<view key="contentView" wantsLayer="YES" id="2LH-tE-efn">
<rect key="frame" x="0.0" y="0.0" width="628" height="613"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<wkWebView wantsLayer="YES" allowsLinkPreview="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p1x-1L-05D">
<rect key="frame" x="0.0" y="0.0" width="628" height="593"/>
<rect key="frame" x="0.0" y="0.0" width="628" height="610"/>
<wkWebViewConfiguration key="configuration" allowsAirPlayForMediaPlayback="NO" suppressesIncrementalRendering="YES">
<audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
<wkPreferences key="preferences" javaScriptCanOpenWindowsAutomatically="NO"/>
Expand All @@ -34,23 +35,27 @@
<outlet property="UIDelegate" destination="-2" id="Qhy-Dl-wsg"/>
</connections>
</wkWebView>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="jsJ-cm-r6Z">
<rect key="frame" x="0.0" y="594" width="628" height="16"/>
<textFieldCell key="cell" selectable="YES" alignment="center" title="Your local password needs to be synced with your cloud password. Please authenticate now." drawsBackground="YES" id="OSE-fi-4md">
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="backgroundColor" name="linkColor" catalog="System" colorSpace="catalog"/>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="YnV-QC-aTR">
<rect key="frame" x="0.0" y="562" width="628" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="JzN-tR-KJo"/>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="628" id="zPs-Yp-tRg"/>
</constraints>
<textFieldCell key="cell" alignment="center" title="Your local password needs to be synced with your cloud password. Please authenticate now." drawsBackground="YES" id="DzZ-yz-JFo">
<font key="font" metaFont="system" size="21"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="backgroundColor" white="0.0062473695290000001" alpha="0.57066289449999996" colorSpace="custom" customColorSpace="calibratedWhite"/>
</textFieldCell>
</textField>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="p1x-1L-05D" secondAttribute="trailing" id="3Xb-lz-75r"/>
<constraint firstItem="jsJ-cm-r6Z" firstAttribute="leading" secondItem="2LH-tE-efn" secondAttribute="leading" id="KNw-iM-Neu"/>
<constraint firstAttribute="trailing" secondItem="jsJ-cm-r6Z" secondAttribute="trailing" id="PYv-Pl-NOI"/>
<constraint firstItem="p1x-1L-05D" firstAttribute="top" secondItem="jsJ-cm-r6Z" secondAttribute="bottom" constant="1" id="amp-UJ-kJX"/>
<constraint firstItem="p1x-1L-05D" firstAttribute="top" secondItem="2LH-tE-efn" secondAttribute="top" constant="3" id="4mY-sf-GcF"/>
<constraint firstItem="YnV-QC-aTR" firstAttribute="leading" secondItem="2LH-tE-efn" secondAttribute="leading" id="HXK-IK-ZHa"/>
<constraint firstItem="p1x-1L-05D" firstAttribute="leading" secondItem="2LH-tE-efn" secondAttribute="leading" id="ejy-F7-Axt"/>
<constraint firstItem="YnV-QC-aTR" firstAttribute="top" secondItem="2LH-tE-efn" secondAttribute="top" constant="1" id="hLH-fg-Sn6"/>
<constraint firstAttribute="trailing" secondItem="YnV-QC-aTR" secondAttribute="trailing" id="jgi-7V-Zhw"/>
<constraint firstAttribute="bottom" secondItem="p1x-1L-05D" secondAttribute="bottom" id="vCP-fw-q3U"/>
<constraint firstItem="jsJ-cm-r6Z" firstAttribute="top" secondItem="2LH-tE-efn" secondAttribute="top" constant="3" id="vae-UG-niS"/>
</constraints>
</view>
<point key="canvasLocation" x="250" y="297.5"/>
Expand Down
4 changes: 2 additions & 2 deletions XCreds/defaults.plist
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
<true/>
<key>shouldShowMacLoginButton</key>
<string>1</string>
<key>shouldShowRefreshBanner</key>
<true/>
<key>KeychainCreate</key>
<true/>
<key>loginWindowBackgroundImageURL</key>
<string>file:///System/Library/Desktop Pictures/Monterey Graphic.heic</string>
<key>shouldShowCloudLoginByDefault</key>
<true/>
<key>autoRefreshLoginTimer</key>
Expand Down
12 changes: 6 additions & 6 deletions xCreds.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3436;
CURRENT_PROJECT_VERSION = 3439;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -940,7 +940,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3436;
CURRENT_PROJECT_VERSION = 3439;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -1001,7 +1001,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3436;
CURRENT_PROJECT_VERSION = 3439;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -1033,7 +1033,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3436;
CURRENT_PROJECT_VERSION = 3439;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -1178,7 +1178,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3436;
CURRENT_PROJECT_VERSION = 3439;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -1209,7 +1209,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3436;
CURRENT_PROJECT_VERSION = 3439;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,21 @@
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "C00BF00C-4ABB-429D-A3A8-FBB5F21C90CE"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "XCreds/WebView.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "29"
endingLineNumber = "29"
landmarkName = "loadPage()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

0 comments on commit 9f29893

Please sign in to comment.