From f88c9a88d2a66b1ca61a5be016960496d10240fe Mon Sep 17 00:00:00 2001 From: 0xFirekeeper <0xFirekeeper@gmail.com> Date: Fri, 11 Oct 2024 00:50:22 +0300 Subject: [PATCH] Remove deprecated iaw-auth-token usage --- .../InAppWallet/EmbeddedWallet.Authentication/Server.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Thirdweb/Thirdweb.Wallets/InAppWallet/EmbeddedWallet.Authentication/Server.cs b/Thirdweb/Thirdweb.Wallets/InAppWallet/EmbeddedWallet.Authentication/Server.cs index 7d8a9f0..1277945 100644 --- a/Thirdweb/Thirdweb.Wallets/InAppWallet/EmbeddedWallet.Authentication/Server.cs +++ b/Thirdweb/Thirdweb.Wallets/InAppWallet/EmbeddedWallet.Authentication/Server.cs @@ -57,10 +57,11 @@ internal Server(ThirdwebClient client, IThirdwebHttpClient httpClient) internal override async Task> LinkAccountAsync(string currentAccountToken, string authTokenToConnect) { var uri = MakeUri2024("/account/connect"); - var content = MakeHttpContent(new { accountAuthTokenToConnect = authTokenToConnect }); - this._httpClient.AddHeader("Authorization", $"Bearer iaw-auth-token:{currentAccountToken}"); - var response = await this._httpClient.PostAsync(uri.ToString(), content).ConfigureAwait(false); - this._httpClient.RemoveHeader("Authorization"); + var request = new HttpRequestMessage(HttpMethod.Post, uri) + { + Content = MakeHttpContent(new { accountAuthTokenToConnect = authTokenToConnect }) + }; + var response = await this.SendHttpWithAuthAsync(request, currentAccountToken).ConfigureAwait(false); await CheckStatusCodeAsync(response).ConfigureAwait(false); var res = await DeserializeAsync(response).ConfigureAwait(false);