Skip to content

Commit

Permalink
feat: change privKey to privateKey in SessionData.kt
Browse files Browse the repository at this point in the history
Signed-off-by: Gaurav Goel <[email protected]>
  • Loading branch information
grvgoel81 authored and Gaurav Goel committed Dec 18, 2024
1 parent dcfb0d5 commit 6bdb106
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/src/main/java/com/web3auth/sfaexample/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class MainActivity : AppCompatActivity() {
singleFactorAuth.initialize(this.applicationContext).whenComplete { res, err ->
if (err == null) {
val text =
"Public Address: ${singleFactorAuth.getSessionData()?.publicAddress} , Private Key: ${singleFactorAuth.getSessionData()?.privKey}"
"Public Address: ${singleFactorAuth.getSessionData()?.publicAddress} , Private Key: ${singleFactorAuth.getSessionData()?.privateKey}"
tv.text = text
}
}
Expand All @@ -75,7 +75,7 @@ class MainActivity : AppCompatActivity() {
val signMsgButton = findViewById<Button>(R.id.signMsgButton)
signMsgButton.setOnClickListener {
val credentials: Credentials =
Credentials.create(singleFactorAuth.getSessionData()?.privKey)
Credentials.create(singleFactorAuth.getSessionData()?.privateKey)
val params = JsonArray().apply {
add("Hello, World!")
add(credentials.address)
Expand Down Expand Up @@ -105,7 +105,7 @@ class MainActivity : AppCompatActivity() {
singleFactorAuth.connect(loginParams, this.applicationContext)
if (sfakey != null) {
val text =
"Public Address: ${sfakey.publicAddress} , Private Key: ${sfakey.privKey}"
"Public Address: ${sfakey.publicAddress} , Private Key: ${sfakey.privateKey}"
tv.text = text
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class SingleFactorAuth(
Gson().fromJson(signaturesJson, object : TypeToken<List<String>>() {}.type)

state = SessionData(
privKey = privateKey,
privateKey = privateKey,
publicAddress = publicAddress,
signatures = finalSignatures,
userInfo = finalUserInfo
Expand Down Expand Up @@ -216,7 +216,7 @@ class SingleFactorAuth(
}

val sessionData = SessionData(
privKey = privateKey.toString(),
privateKey = privateKey.toString(),
publicAddress = publicAddress.toString(),
signatures = getSignatureData(torusKey.sessionData.sessionTokenData),
userInfo = decodedUserInfo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.web3auth.singlefactorauth.types

import com.google.gson.annotations.SerializedName
import java.io.Serializable

data class SessionData(
val privKey: String,
@SerializedName("privKey") val privateKey: String,
val publicAddress: String,
val signatures: List<String>? = null,
val userInfo: UserInfo? = null,
Expand Down

0 comments on commit 6bdb106

Please sign in to comment.