From 8d61c7e1b42e4aac9744d6a021fd94ceb859fbca Mon Sep 17 00:00:00 2001 From: Arian Flores Date: Wed, 1 Mar 2023 13:15:53 -0800 Subject: [PATCH] Simplifies Logging and Cleans up Code --- .../MagicExt-OAuth/Core/OAuthExtension.swift | 19 +------------------ .../MagicExt-OIDC/Core/OIDCExtension.swift | 15 +-------------- 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/Sources/MagicExt-OAuth/Core/OAuthExtension.swift b/Sources/MagicExt-OAuth/Core/OAuthExtension.swift index 9873b81..5b34823 100644 --- a/Sources/MagicExt-OAuth/Core/OAuthExtension.swift +++ b/Sources/MagicExt-OAuth/Core/OAuthExtension.swift @@ -11,7 +11,6 @@ import SafariServices import MagicSDK_Web3 import MagicSDK import PromiseKit -import os public class OAuthExtension: BaseModule { @@ -35,9 +34,6 @@ public class OAuthExtension: BaseModule { var components = URLComponents() components.scheme = "https" components.host = "auth.magic.link" -// components.scheme = "http" -// components.host = "192.168.0.106" -// components.port = 3014 components.path = "/v1/oauth2/\(configuration.provider.rawValue.lowercased())/start" components.queryItems = [ @@ -79,7 +75,6 @@ public class OAuthExtension: BaseModule { }.catch { error in let errResponse = Web3Response(error: OAuthExtensionError.userDeniedAccess(error)) response(errResponse) -// handleRollbarError(error, log: false) } } @@ -123,21 +118,9 @@ public class OAuthExtension: BaseModule { } extension Magic { - @available(iOS 14.0, *) - private static let logger = Logger( - subsystem: Bundle.main.bundleIdentifier!, - category: String(describing: Magic.self) - ) - - private static let MA_EXTENSION_ONLY_MSG = "This extension only works with Magic Auth API Keys" public var oauth: OAuthExtension { - if #available(iOS 14.0, *) { - Magic.logger.warning("\(Magic.MA_EXTENSION_ONLY_MSG)") - } else { - print(Magic.MA_EXTENSION_ONLY_MSG) - } - + print(self.MA_EXTENSION_ONLY_MSG) return OAuthExtension(rpcProvider: self.rpcProvider) } } diff --git a/Sources/MagicExt-OIDC/Core/OIDCExtension.swift b/Sources/MagicExt-OIDC/Core/OIDCExtension.swift index 57db729..0a70f72 100644 --- a/Sources/MagicExt-OIDC/Core/OIDCExtension.swift +++ b/Sources/MagicExt-OIDC/Core/OIDCExtension.swift @@ -8,7 +8,6 @@ import Foundation import MagicSDK_Web3 import MagicSDK -import os public class OIDCExtension: BaseModule { @@ -19,21 +18,9 @@ public class OIDCExtension: BaseModule { } extension Magic { - @available(iOS 14.0, *) - private static let logger = Logger( - subsystem: Bundle.main.bundleIdentifier!, - category: String(describing: Magic.self) - ) - - private static let MA_EXTENSION_ONLY_MSG = "This extension only works with Magic Auth API Keys" public var openid: OIDCExtension { - if #available(iOS 14.0, *) { - Magic.logger.warning("\(Magic.MA_EXTENSION_ONLY_MSG)") - } else { - print("\(Magic.MA_EXTENSION_ONLY_MSG)") - } - + print("\(self.MA_EXTENSION_ONLY_MSG)") return OIDCExtension(rpcProvider: self.rpcProvider) } }