Skip to content

Commit ebe3650

Browse files
sdk url default
1 parent 6bc1413 commit ebe3650

File tree

3 files changed

+27
-24
lines changed

3 files changed

+27
-24
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/java/com/web3auth/app/MainActivity.kt

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -114,31 +114,34 @@ class MainActivity : AppCompatActivity(), AdapterView.OnItemClickListener {
114114
super.onCreate(savedInstanceState)
115115
setContentView(R.layout.activity_main)
116116

117-
// Configure Web3Auth
118-
web3Auth = Web3Auth(
119-
Web3AuthOptions(
120-
context = this,
121-
clientId = getString(R.string.web3auth_project_id),
122-
network = Network.SAPPHIRE_DEVNET,
123-
buildEnv = BuildEnv.TESTING,
124-
redirectUrl = Uri.parse("torusapp://org.torusresearch.web3authexample"),
125-
whiteLabel = WhiteLabelData(
126-
"Web3Auth Sample App", null, null, null,
127-
Language.EN, ThemeModes.LIGHT, true,
128-
hashMapOf(
129-
"primary" to "#123456"
130-
)
131-
),
132-
loginConfig = hashMapOf(
133-
"loginConfig" to LoginConfigItem(
134-
"torus",
135-
typeOfLogin = TypeOfLogin.GOOGLE,
136-
name = ""
137-
)
117+
val options = Web3AuthOptions(
118+
context = this,
119+
clientId = getString(R.string.web3auth_project_id),
120+
network = Network.SAPPHIRE_DEVNET,
121+
redirectUrl = Uri.parse("torusapp://org.torusresearch.web3authexample"),
122+
whiteLabel = WhiteLabelData(
123+
"Web3Auth Sample App", null, null, null,
124+
Language.EN, ThemeModes.LIGHT, true,
125+
hashMapOf(
126+
"primary" to "#123456"
127+
)
128+
),
129+
loginConfig = hashMapOf(
130+
"loginConfig" to LoginConfigItem(
131+
"torus",
132+
typeOfLogin = TypeOfLogin.GOOGLE,
133+
name = ""
138134
)
139135
)
140136
)
141137

138+
println("params: $options")
139+
140+
// Configure Web3Auth
141+
web3Auth = Web3Auth(
142+
options
143+
)
144+
142145
web3Auth.setResultUrl(intent.data)
143146

144147
// for session response

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ data class Web3AuthOptions(
77
var context: Context,
88
val clientId: String,
99
val network: Network,
10-
var buildEnv: BuildEnv,
10+
var buildEnv: BuildEnv? = BuildEnv.PRODUCTION,
1111
@Transient var redirectUrl: Uri? = null,
1212
var sdkUrl: String = getSdkUrl(buildEnv),
1313
val whiteLabel: WhiteLabelData? = null,
@@ -17,7 +17,7 @@ data class Web3AuthOptions(
1717
val mfaSettings: MfaSettings? = null
1818
)
1919

20-
fun getSdkUrl(buildEnv: BuildEnv): String {
20+
fun getSdkUrl(buildEnv: BuildEnv?): String {
2121
val sdkUrl: String = when (buildEnv) {
2222
BuildEnv.STAGING -> {
2323
"https://staging-auth.web3auth.io/$openLoginVersion"

0 commit comments

Comments
 (0)