Skip to content

Commit 20d30e5

Browse files
committed
feat: Increase min sesssionTime to 30 days
Signed-off-by: Gaurav Goel <[email protected]>
1 parent 693eabe commit 20d30e5

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

core/src/main/java/com/web3auth/core/Web3Auth.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions, context: Context) : WebViewResu
5555
private var web3AuthOption = web3AuthOptions
5656
private var sessionManager: SessionManager = SessionManager(
5757
context,
58-
web3AuthOptions.sessionTime ?: 600,
58+
web3AuthOptions.sessionTime ?: 30 * 86400,
5959
web3AuthOptions.redirectUrl.toString()
6060
)
6161

@@ -152,7 +152,6 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions, context: Context) : WebViewResu
152152
"appState",
153153
gson.toJson(loginIdObject).toByteArray(Charsets.UTF_8).toBase64URLString()
154154
)
155-
initParamsJson.put("platform", "android")
156155
initParamsJson.put("dappUrl", web3AuthOption.redirectUrl)
157156
paramMap.put("sessionId", sessionManager.getSessionId())
158157
}
@@ -166,7 +165,10 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions, context: Context) : WebViewResu
166165
val loginIdCf = getLoginId(sessionId, paramsString)
167166
loginIdCf.whenComplete { loginId, error ->
168167
if (error == null) {
169-
val jsonObject = mapOf("loginId" to loginId)
168+
val jsonObject = mapOf(
169+
"loginId" to loginId,
170+
"platform" to "android"
171+
)
170172

171173
val hash = "b64Params=" + gson.toJson(jsonObject).toByteArray(Charsets.UTF_8)
172174
.toBase64URLString()

core/src/main/java/com/web3auth/core/types/Web3AuthOptions.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ data class Web3AuthOptions(
1313
val useCoreKitKey: Boolean? = false,
1414
val chainNamespace: ChainNamespace? = ChainNamespace.EIP155,
1515
val mfaSettings: MfaSettings? = null,
16-
val sessionTime: Int? = 86400,
16+
val sessionTime: Int? = 30 * 86400,
1717
var walletSdkUrl: String? = getWalletSdkUrl(buildEnv),
1818
var dashboardUrl: String? = getDashBoardUrl(buildEnv),
1919
var originData: Map<String, String>? = null

0 commit comments

Comments
 (0)