Skip to content

Commit 24475eb

Browse files
committed
Fix magic link internal server error
1 parent 0244685 commit 24475eb

File tree

5 files changed

+99
-267
lines changed

5 files changed

+99
-267
lines changed

Assets/Thirdweb/Core/Scripts/ThirdwebSDK.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ public NativeSession(WalletProvider provider, int lastChainId, string lastRPC, A
146146
appName = options.wallet?.appName ?? "Thirdweb Game",
147147
appDescription = options.wallet?.appDescription ?? "Thirdweb Game Demo",
148148
appIcons = options.wallet?.appIcons ?? new string[] { "https://thirdweb.com/favicon.ico" },
149-
appUrl = options.wallet?.appUrl ?? "https://thirdweb.com"
149+
appUrl = options.wallet?.appUrl ?? "https://thirdweb.com",
150+
magicLinkApiKey = options.wallet?.magicLinkApiKey,
150151
};
151152

152153
FetchChainData();

Assets/Thirdweb/Core/Scripts/Wallet.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ public async Task<string> Connect(WalletConnection walletConnection)
106106
await new WaitForSeconds(0.5f);
107107
}
108108

109+
if (ThirdwebManager.Instance.SDK.nativeSession.options.wallet?.magicLinkApiKey == null)
110+
throw new UnityException("MagicLink API Key is not set!");
111+
109112
MagicUnity.Instance.Initialize(
110113
ThirdwebManager.Instance.SDK.nativeSession.options.wallet?.magicLinkApiKey,
111114
new link.magic.unity.sdk.Relayer.CustomNodeConfiguration(oldSession.lastRPC, oldSession.lastChainId)
@@ -528,7 +531,7 @@ public async Task<string> RecoverAddress(string message, string signature)
528531
{
529532
var signer = new EthereumMessageSigner();
530533
var addressRecovered = signer.EncodeUTF8AndEcRecover(message, signature);
531-
return addressRecovered; // TODO: Check viability
534+
return addressRecovered;
532535
}
533536
}
534537

0 commit comments

Comments
 (0)