diff --git a/session-manager-android/src/androidTest/java/com/web3auth/session_manager_android/SessionManagerTest.kt b/session-manager-android/src/androidTest/java/com/web3auth/session_manager_android/SessionManagerTest.kt index 52dcff8..00f9368 100644 --- a/session-manager-android/src/androidTest/java/com/web3auth/session_manager_android/SessionManagerTest.kt +++ b/session-manager-android/src/androidTest/java/com/web3auth/session_manager_android/SessionManagerTest.kt @@ -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", @@ -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", diff --git a/session-manager-android/src/main/java/com/web3auth/session_manager_android/SessionManager.kt b/session-manager-android/src/main/java/com/web3auth/session_manager_android/SessionManager.kt index 4657ba0..a033623 100644 --- a/session-manager-android/src/main/java/com/web3auth/session_manager_android/SessionManager.kt +++ b/session-manager-android/src/main/java/com/web3auth/session_manager_android/SessionManager.kt @@ -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 { @@ -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 } }