Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Update Web3Auth SDK to v2.1.1 #224

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Runtime/Plugins/Web3AuthSDK/Types/AES256CBC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public byte[] hmacSha256Sign(byte[] key, byte[] data)
public bool hmacSha256Verify(byte[] key, byte[] data, string sig)
{
byte[] expectedSig = hmacSha256Sign(key, data);
string expectedSigHex = BitConverter.ToString(expectedSig).Replace("-", "").ToLower();
string expectedSigHex = BitConverter.ToString(expectedSig).Replace("-", "").ToLowerInvariant();
return expectedSigHex.Equals(sig);
}
}
2 changes: 1 addition & 1 deletion Runtime/Plugins/Web3AuthSDK/Types/LoginParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ public class LoginParams
[Preserve]
public MFALevel mfaLevel { get; set; }
[Preserve]
public Curve curve { get; set; }
public Curve curve { get; set; } = Curve.SECP256K1;
}
4 changes: 2 additions & 2 deletions Runtime/Plugins/Web3AuthSDK/Types/Web3AuthOptions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
#nullable enable
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
Expand All @@ -20,7 +20,7 @@ public string sdkUrl {
}
set { }
}
public const string openLoginVersion = "v5";
public const string openLoginVersion = "v6";

public WhiteLabelData? whiteLabel { get; set; }
public Dictionary<string, LoginConfigItem>? loginConfig { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Plugins/Web3AuthSDK/Types/Web3AuthResponse.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using UnityEngine.Scripting;

[Serializable]
Expand Down
14 changes: 8 additions & 6 deletions Runtime/Plugins/Web3AuthSDK/Web3Auth.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -62,7 +62,7 @@ public void Awake()
this.initParams = new Dictionary<string, object>();

this.initParams["clientId"] = clientId;
this.initParams["network"] = network.ToString().ToLower();
this.initParams["network"] = network.ToString().ToLowerInvariant();

if (!string.IsNullOrEmpty(redirectUri))
this.initParams["redirectUrl"] = redirectUri;
Expand Down Expand Up @@ -108,12 +108,13 @@ public void setOptions(Web3AuthOptions web3AuthOptions)
if (this.web3AuthOptions.loginConfig != null)
this.initParams["loginConfig"] = JsonConvert.SerializeObject(this.web3AuthOptions.loginConfig, settings);

if (!string.IsNullOrEmpty(this.web3AuthOptions.clientId))
if (this.web3AuthOptions.clientId != null)
this.initParams["clientId"] = this.web3AuthOptions.clientId;

this.initParams["buildEnv"] = this.web3AuthOptions.buildEnv.ToString().ToLower();
if (this.web3AuthOptions.buildEnv != null)
this.initParams["buildEnv"] = this.web3AuthOptions.buildEnv.ToString().ToLowerInvariant();

this.initParams["network"] = this.web3AuthOptions.network.ToString().ToLower();
this.initParams["network"] = this.web3AuthOptions.network.ToString().ToLowerInvariant();

if (this.web3AuthOptions.useCoreKitKey.HasValue)
this.initParams["useCoreKitKey"] = this.web3AuthOptions.useCoreKitKey.Value;
Expand All @@ -124,7 +125,8 @@ public void setOptions(Web3AuthOptions web3AuthOptions)
if (this.web3AuthOptions.mfaSettings != null)
this.initParams["mfaSettings"] = JsonConvert.SerializeObject(this.web3AuthOptions.mfaSettings, settings);

this.initParams["sessionTime"] = this.web3AuthOptions.sessionTime;
if (this.web3AuthOptions.sessionTime != null)
this.initParams["sessionTime"] = this.web3AuthOptions.sessionTime;
}

private void onDeepLinkActivated(string url)
Expand Down