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

Commit

Permalink
Adds MA ONLY Warning Log to OIDC Extension
Browse files Browse the repository at this point in the history
  • Loading branch information
Ariflo committed Feb 17, 2023
1 parent 18f109e commit 6b0e3a3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Sources/MagicExt-OIDC/Core/OIDCExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import Foundation
import MagicSDK_Web3
import MagicSDK
import os

public class OIDCExtension: BaseModule {

Expand All @@ -18,7 +19,21 @@ 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)")
}

return OIDCExtension(rpcProvider: self.rpcProvider)
}
}

0 comments on commit 6b0e3a3

Please sign in to comment.