From 30a8d1f91f765a53ecb11699c18d2669be40f6fa Mon Sep 17 00:00:00 2001 From: ieow Date: Fri, 23 Feb 2024 09:39:45 +0800 Subject: [PATCH] fix: add web3AuthClientId --- Sources/SingleFactorAuth/SingleFactorAuth.swift | 3 ++- Sources/SingleFactorAuth/SingleFactorAuthArgs.swift | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Sources/SingleFactorAuth/SingleFactorAuth.swift b/Sources/SingleFactorAuth/SingleFactorAuth.swift index 2d11ca7..b11b5a9 100644 --- a/Sources/SingleFactorAuth/SingleFactorAuth.swift +++ b/Sources/SingleFactorAuth/SingleFactorAuth.swift @@ -18,7 +18,8 @@ public class SingleFactorAuth { enableOneKey: true, signerHost: singleFactorAuthArgs.getSignerUrl()! + "/api/sign", allowHost: singleFactorAuthArgs.getSignerUrl()! + "/api/allow", - network: singleFactorAuthArgs.getNetwork() + network: singleFactorAuthArgs.getNetwork(), + clientId: singleFactorAuthArgs.getWeb3AuthClientId() ) } diff --git a/Sources/SingleFactorAuth/SingleFactorAuthArgs.swift b/Sources/SingleFactorAuth/SingleFactorAuthArgs.swift index f40cc26..f98d837 100644 --- a/Sources/SingleFactorAuth/SingleFactorAuthArgs.swift +++ b/Sources/SingleFactorAuth/SingleFactorAuthArgs.swift @@ -14,10 +14,16 @@ public class SingleFactorAuthArgs { private var network: TorusNetwork private var networkUrl: String + private var web3AuthClientId: String - public init(network: TorusNetwork, networkUrl: String = "") { + public init(web3AuthClientId: String = "", network: TorusNetwork, networkUrl: String = "") { self.network = network self.networkUrl = networkUrl + self.web3AuthClientId = web3AuthClientId + } + + public func getWeb3AuthClientId() -> String { + return web3AuthClientId } public func getNetwork() -> TorusNetwork {