Skip to content

Commit fcff429

Browse files
committed
code fixed
1 parent ca233e6 commit fcff429

File tree

2 files changed

+12
-36
lines changed

2 files changed

+12
-36
lines changed

Assets/Plugins/Web3AuthSDK/Types/Web3AuthOptions.cs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,21 @@
22
using System.Collections.Generic;
33

44
public class Web3AuthOptions {
5-
//public context: Context,
65
public string clientId { get; set; }
76
public Web3Auth.Network network { get; set; }
87
public Uri redirectUrl { get; set; }
9-
public string sdkUrl { get; set; } = getSdkUrl(network);
8+
public string sdkUrl {
9+
get {
10+
if (network == Web3Auth.Network.TESTNET)
11+
return "https://dev-sdk.openlogin.com";
12+
else
13+
return "https://sdk.openlogin.com";
14+
}
15+
set { }
16+
}
17+
1018
public WhiteLabelData whiteLabel { get; set; }
1119
public Dictionary<string, LoginConfigItem> loginConfig { get; set; }
1220
public bool? useCoreKitKey { get; set; } = false;
1321
public Web3Auth.ChainNamespace? chainNamespace { get; set; } = Web3Auth.ChainNamespace.EIP155;
14-
15-
public string getSdkUrl(Web3Auth.Network network)
16-
{
17-
string sdkUrl = "";
18-
if (network == Web3Auth.Network.TESTNET)
19-
{
20-
sdkUrl = "https://dev-sdk.openlogin.com";
21-
}
22-
else
23-
{
24-
sdkUrl = "https://sdk.openlogin.com";
25-
}
26-
return sdkUrl;
27-
}
2822
}

Assets/Plugins/Web3AuthSDK/Web3Auth.cs

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -418,30 +418,12 @@ private void sessionTimeOutAPI()
418418

419419
public string getPrivKey()
420420
{
421-
string privKey = "";
422-
if (web3AuthOption.useCoreKitKey == true)
423-
{
424-
privKey = web3AuthResponse.coreKitKey.ToString();
425-
}
426-
else
427-
{
428-
privKey = web3AuthResponse.privKey.ToString();
429-
}
430-
return privKey;
421+
return web3AuthOptions.useCoreKitKey.Value ? web3AuthResponse.coreKitKey : web3AuthResponse.privKey;
431422
}
432423

433424
public string getEd25519PrivKey()
434425
{
435-
string ed25519Key = "";
436-
if (web3AuthOption.useCoreKitKey == true)
437-
{
438-
ed25519Key = web3AuthResponse.coreKitEd25519PrivKey.ToString();
439-
}
440-
else
441-
{
442-
ed25519Key = web3AuthResponse.ed25519PrivKey.ToString();
443-
}
444-
return ed25519Key;
426+
return web3AuthOptions.useCoreKitKey.Value ? web3AuthResponse.coreKitEd25519PrivKey : web3AuthResponse.ed25519PrivKey;
445427
}
446428

447429
public UserInfo getUserInfo()

0 commit comments

Comments
 (0)