Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
Simplifies Logging and Cleans up Code
Browse files Browse the repository at this point in the history
  • Loading branch information
Ariflo committed Mar 1, 2023
1 parent 6b0e3a3 commit 8d61c7e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 32 deletions.
19 changes: 1 addition & 18 deletions Sources/MagicExt-OAuth/Core/OAuthExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import SafariServices
import MagicSDK_Web3
import MagicSDK
import PromiseKit
import os

public class OAuthExtension: BaseModule {

Expand All @@ -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 = [
Expand Down Expand Up @@ -79,7 +75,6 @@ public class OAuthExtension: BaseModule {
}.catch { error in
let errResponse = Web3Response<OAuthResponse>(error: OAuthExtensionError.userDeniedAccess(error))
response(errResponse)
// handleRollbarError(error, log: false)
}
}

Expand Down Expand Up @@ -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)
}
}
Expand Down
15 changes: 1 addition & 14 deletions Sources/MagicExt-OIDC/Core/OIDCExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import Foundation
import MagicSDK_Web3
import MagicSDK
import os

public class OIDCExtension: BaseModule {

Expand All @@ -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)
}
}

0 comments on commit 8d61c7e

Please sign in to comment.