Skip to content

Commit

Permalink
merge user info with params
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshu committed Aug 31, 2023
1 parent 756b214 commit 1b2de26
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Sources/CustomAuth/CustomAuth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,12 @@ open class CustomAuth {
let idToken = data["tokenForKeys"] as! String
data.removeValue(forKey: "tokenForKeys")
data.removeValue(forKey: "verifierId")


let torusKey = try await getTorusKey(verifier: self.aggregateVerifier, verifierId: verifierId, idToken: idToken, userData: data)
var result = TorusKeyData(torusKey: torusKey, userInfo: newData)
result.userInfo["verifier"] = self.aggregateVerifier
var mergedUserInfo = newData.merging(responseParameters) { (_, new) in new }
mergedUserInfo["verifier"] = self.aggregateVerifier
let result = TorusKeyData(torusKey: torusKey, userInfo: mergedUserInfo)
return result
} catch {
os_log("handleSingleLogin: err: %s", log: getTorusLogger(log: CASDKLogger.core, type: .error), type: .error, error.localizedDescription)
Expand Down Expand Up @@ -182,8 +185,9 @@ open class CustomAuth {
data.removeValue(forKey: "tokenForKeys")
data.removeValue(forKey: "verifierId")
let aggTorusKey = try await getAggregateTorusKey(verifier: self.aggregateVerifier, verifierId: verifierId, idToken: idToken, subVerifierDetails: subVerifier, userData: newData)
var result = TorusKeyData(torusKey: aggTorusKey, userInfo: newData)
result.userInfo["verifier"] = self.aggregateVerifier
var mergedUserInfo = newData.merging(responseParameters) { (_, new) in new }
mergedUserInfo["verifier"] = self.aggregateVerifier
let result = TorusKeyData(torusKey: aggTorusKey, userInfo: mergedUserInfo)
return result
} catch {
os_log("handleSingleIdVerifier err: %s", log: getTorusLogger(log: CASDKLogger.core, type: .error), type: .error, error.localizedDescription)
Expand Down

0 comments on commit 1b2de26

Please sign in to comment.