This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The model | |
public struct UserCredentials: Equatable, Codable { | |
// This silly variable can come nback as emoty, but no fret it is encrypted inside the jwtToken | |
// and the server will be able to extract it. | |
public var email: String | |
public var jwtToken: String | |
public var userId: String | |
public var isEmpty: Bool { | |
email.isEmpty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
/** | |
hack to avoid crashes on window close, and remove the window from the | |
NSApplication stack, ie: avoid leaking window objects | |
*/ | |
fileprivate final class WindowDelegate: NSObject, NSWindowDelegate { | |
func windowShouldClose(_ sender: NSWindow) -> Bool { | |
NSApp.removeWindowsItem(sender) | |
return true |