Skip to content

Commit

Permalink
Fix magic link internal server error
Browse files Browse the repository at this point in the history
  • Loading branch information
0xFirekeeper committed May 24, 2023
1 parent 0244685 commit 24475eb
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 267 deletions.
3 changes: 2 additions & 1 deletion Assets/Thirdweb/Core/Scripts/ThirdwebSDK.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ public NativeSession(WalletProvider provider, int lastChainId, string lastRPC, A
appName = options.wallet?.appName ?? "Thirdweb Game",
appDescription = options.wallet?.appDescription ?? "Thirdweb Game Demo",
appIcons = options.wallet?.appIcons ?? new string[] { "https://thirdweb.com/favicon.ico" },
appUrl = options.wallet?.appUrl ?? "https://thirdweb.com"
appUrl = options.wallet?.appUrl ?? "https://thirdweb.com",
magicLinkApiKey = options.wallet?.magicLinkApiKey,
};

FetchChainData();
Expand Down
5 changes: 4 additions & 1 deletion Assets/Thirdweb/Core/Scripts/Wallet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ public async Task<string> Connect(WalletConnection walletConnection)
await new WaitForSeconds(0.5f);
}

if (ThirdwebManager.Instance.SDK.nativeSession.options.wallet?.magicLinkApiKey == null)
throw new UnityException("MagicLink API Key is not set!");

MagicUnity.Instance.Initialize(
ThirdwebManager.Instance.SDK.nativeSession.options.wallet?.magicLinkApiKey,
new link.magic.unity.sdk.Relayer.CustomNodeConfiguration(oldSession.lastRPC, oldSession.lastChainId)
Expand Down Expand Up @@ -528,7 +531,7 @@ public async Task<string> RecoverAddress(string message, string signature)
{
var signer = new EthereumMessageSigner();
var addressRecovered = signer.EncodeUTF8AndEcRecover(message, signature);
return addressRecovered; // TODO: Check viability
return addressRecovered;
}
}

Expand Down
Loading

0 comments on commit 24475eb

Please sign in to comment.