diff --git a/Music Tools.xcodeproj/project.pbxproj b/Music Tools.xcodeproj/project.pbxproj index 890ba4b..c716158 100644 --- a/Music Tools.xcodeproj/project.pbxproj +++ b/Music Tools.xcodeproj/project.pbxproj @@ -535,7 +535,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.2; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -590,7 +590,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.2; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; diff --git a/Music Tools.xcodeproj/xcshareddata/xcschemes/Music Tools.xcscheme b/Music Tools.xcodeproj/xcshareddata/xcschemes/Music Tools.xcscheme new file mode 100644 index 0000000..c1e58d9 --- /dev/null +++ b/Music Tools.xcodeproj/xcshareddata/xcschemes/Music Tools.xcscheme @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Music Tools/Network/Network.swift b/Music Tools/Network/Network.swift index 9e90cd7..aa793f0 100644 --- a/Music Tools/Network/Network.swift +++ b/Music Tools/Network/Network.swift @@ -56,7 +56,17 @@ struct RequestBuilder { struct ApiRequestDefaults { static let authMethod: AuthMethod = .basic - static let domain: String = "https://music.sarsoo.xyz/" + static var domain: String { get { + + let default_url = "https://music.sarsoo.xyz/" + + switch getenv("MTOOLS_SERVER") { + case .none: + return default_url + case .some(let url): + return String(utf8String: url) ?? default_url + } + } } } protocol ApiRequest { diff --git a/Music Tools/Views/LoginScreen.swift b/Music Tools/Views/LoginScreen.swift index aa9b97f..0e63625 100644 --- a/Music Tools/Views/LoginScreen.swift +++ b/Music Tools/Views/LoginScreen.swift @@ -7,6 +7,7 @@ // import SwiftUI +import KeychainAccess struct LoginScreen: View { @@ -29,6 +30,12 @@ struct LoginScreen: View { SecureField("Password", text: $password) HStack { Button(action: { + + let keychain = Keychain(service: "xyz.sarsoo.music.login") + + keychain["username"] = username + keychain["password"] = password + self.liveUser.loggedIn = true }) { Text("Log In")