Skip to content

Commit

Permalink
added fade to login window complete
Browse files Browse the repository at this point in the history
  • Loading branch information
twocanoes committed Jul 3, 2022
1 parent 6addc79 commit 3fd2f6d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 24 deletions.
1 change: 1 addition & 0 deletions XCreds/MainController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class MainController: NSObject {

DispatchQueue.main.async {
let keychainUtil = KeychainUtil()
mainMenu.webView?.window?.close()

guard let tokenInfo = notification.userInfo else {
return
Expand Down
8 changes: 0 additions & 8 deletions XCreds/WebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,8 @@ extension WebViewController: OIDCLiteDelegate {
func tokenResponse(tokens: OIDCLiteTokenResponse) {
TCSLog("tokenResponse")
RunLoop.main.perform {
self.window?.close()
if let password = self.password {
TCSLog("password received")
// let tokensDict = [
// "password":password,
// PrefKeys.accessToken.rawValue:tokens.accessToken ?? "",
// PrefKeys.idToken.rawValue:tokens.idToken ?? "",
// PrefKeys.refreshToken.rawValue:tokens.refreshToken ?? ""
//
// ]
let returnTokens = Tokens(password: password, accessToken: tokens.accessToken ?? "", idToken: tokens.idToken ?? "", refreshToken: tokens.refreshToken ?? "")
self.tokensUpdated(tokens: returnTokens)
NotificationCenter.default.post(name: Notification.Name("TCSTokensUpdated"), object: self, userInfo:["tokens":returnTokens]
Expand Down
10 changes: 10 additions & 0 deletions XCredsLoginPlugIn/LoginWebViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ class LoginWebViewController: WebViewController {
@objc override var windowNibName: NSNib.Name {
return NSNib.Name("LoginWebView")
}
func loginTransition() {

NSAnimationContext.runAnimationGroup({ (context) in
context.duration = 1.0
context.allowsImplicitAnimation = true
self.window?.alphaValue = 0.0
}, completionHandler: {
self.window?.close()
})
}

}

Expand Down
3 changes: 3 additions & 0 deletions XCredsLoginPlugIn/XCredsMechanism.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ import os.log
self.setContextString(type: kAuthorizationEnvironmentUsername, value: "tperfitt")
self.setContextString(type: kAuthorizationEnvironmentPassword, value: tokens.password)
self.allowLogin()
RunLoop.main.perform {
self.webViewController.loginTransition()

}
}
setupPrefs()

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,6 @@
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "2A5911CE-8023-4A4F-AD53-6A980594B6DC"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "XCreds/MainController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "28"
endingLineNumber = "28"
landmarkName = "run()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
Expand Down

0 comments on commit 3fd2f6d

Please sign in to comment.