Skip to content

Commit

Permalink
feat: PR comments addressed
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 17, 2024
1 parent c0f6367 commit 02dbd23
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SessionManagerTest {
fun test_createSession() {
val context = InstrumentationRegistry.getInstrumentation().context
val sessionId = SessionManager.generateRandomSessionKey()
sessionManager = SessionManager(context, 86400, context.packageName, sessionId, "*")
sessionManager = SessionManager(context, 86400, context.packageName, sessionId)
val json = JSONObject()
json.put(
"privateKey",
Expand Down Expand Up @@ -68,7 +68,7 @@ class SessionManagerTest {
fun test_invalidateSession() {
val context = InstrumentationRegistry.getInstrumentation().context
val sessionId = SessionManager.generateRandomSessionKey()
sessionManager = SessionManager(context, 86400, context.packageName, sessionId, "sfa")
sessionManager = SessionManager(context, 86400, context.packageName, sessionId)
val json = JSONObject()
json.put(
"privateKey",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class SessionManager(
private val web3AuthApi = ApiHelper.getInstance().create(Web3AuthApi::class.java)
private var sessionTime: Int
private var allowedOrigin: String
private lateinit var sessionNamespace: String
private var sessionNamespace: String = ""
private lateinit var sessionId: String

companion object {
Expand All @@ -61,12 +61,12 @@ class SessionManager(
init {
KeyStoreManager.initializePreferences(context.applicationContext)
initiateKeyStoreManager()
if (sessionId != null && sessionId.isNotEmpty()) {
if (!sessionId.isNullOrEmpty()) {
this.sessionId = sessionId
}
this.sessionTime = sessionTime
this.allowedOrigin = allowedOrigin
if (sessionNamespace != null) {
if (!sessionNamespace.isNullOrEmpty()) {
this.sessionNamespace = sessionNamespace
}
}
Expand Down

0 comments on commit 02dbd23

Please sign in to comment.