Skip to content

Commit

Permalink
✨ Update web3auth sdk to v2.1.1 (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielePicco authored Apr 22, 2024
1 parent 695981a commit fe5466e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
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

0 comments on commit fe5466e

Please sign in to comment.