Skip to content

Commit

Permalink
Merge pull request #9 from Web3Auth/feat/verBump
Browse files Browse the repository at this point in the history
Feat/ver bump
  • Loading branch information
chaitanyapotti authored Jun 6, 2023
2 parents 07932ff + ed8b7d7 commit 9d30f9f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/torusresearch/torus-utils-swift",
"state" : {
"revision" : "902bf105ecfb5cb83dc1911692163289633316f5",
"version" : "4.0.0"
"revision" : "93823201f248ce15dab59c027790da4b73375aed",
"version" : "5.0.0"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ let package = Package(
targets: ["SingleFactorAuth"])
],
dependencies: [
.package(url: "https://github.com/torusresearch/fetch-node-details-swift.git", from: "4.0.0"),
.package(url: "https://github.com/torusresearch/torus-utils-swift.git", from: "4.0.0"),
.package(url: "https://github.com/torusresearch/fetch-node-details-swift.git", from: "4.0.1"),
.package(url: "https://github.com/torusresearch/torus-utils-swift.git", from: "5.0.0"),
.package(url: "https://github.com/vapor/jwt-kit.git", from: "4.0.0"),
.package(name: "SessionManager", url: "https://github.com/Web3Auth/session-manager-swift.git", from: "2.0.0")
],
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ We also have included Session Management in this SDK so call initialize function
print(savedKey.getPrivateKey())
print(savedKey.getPublicAddress())
}
```

## Requirements
Expand Down
4 changes: 2 additions & 2 deletions SingleFactorAuth.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Pod::Spec.new do |spec|
spec.module_name = "SingleFactorAuth"
spec.source = { :git => "https://github.com/web3Auth/single-factor-auth-swift", :tag => spec.version }
spec.source_files = "Sources/SingleFactorAuth/*.{swift,json}","Sources/SingleFactorAuth/**/*.{swift,json}"
spec.dependency 'Torus-fetchNodeDetails', '~> 4.0.0'
spec.dependency 'Torus-utils', '~> 4.0.0'
spec.dependency 'Torus-fetchNodeDetails', '~> 4.0.1'
spec.dependency 'Torus-utils', '~> 5.0.0'
spec.dependency 'TorusSessionManager', '~> 2.0.0'
end
7 changes: 2 additions & 5 deletions Sources/SingleFactorAuth/SingleFactorAuth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class SingleFactorAuth {
}

public func getKey(loginParams: LoginParams) async throws -> TorusKey {
var retrieveSharesResponse: [String: String] = [:]
var retrieveSharesResponse: RetrieveSharesResponseModel

do {
var details = try await self.nodeDetailManager.getNodeDetails(verifier: loginParams.verifier, verifierID: loginParams.verifierId)
Expand Down Expand Up @@ -103,15 +103,12 @@ public class SingleFactorAuth {
extraParams: buffer
)
}
if retrieveSharesResponse["privateKey"] == nil {
throw "Unable to generate privKey"
}

} catch {
throw error
}

let torusKey = TorusKey(privateKey: (retrieveSharesResponse["privateKey"])!, publicAddress: retrieveSharesResponse["publicAddress"]!)
let torusKey = TorusKey(privateKey: retrieveSharesResponse.privateKey, publicAddress: retrieveSharesResponse.publicAddress)
try await sessionManager.createSession(data: torusKey)
return torusKey
}
Expand Down

0 comments on commit 9d30f9f

Please sign in to comment.