Skip to content

Commit b0648f1

Browse files
authored
Line OAuth & Linkin (#69)
1 parent 5f9b5c2 commit b0648f1

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

Thirdweb.Console/Program.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,11 @@
206206
// }
207207
// Console.WriteLine($"Main InAppWallet address: {await inAppWalletMain.GetAddress()}");
208208

209-
// var inAppWalletToLink = await InAppWallet.Create(client: client, authProvider: AuthProvider.Siwe, siweSigner: privateKeyWallet);
210-
// _ = inAppWalletToLink.SendOTP();
211-
// Console.WriteLine("Enter OTP:");
212-
// var otp = Console.ReadLine();
213-
// _ = await inAppWalletMain.LinkAccount(walletToLink: inAppWalletToLink, otp: otp);
209+
// var oldLinkedAccounts = await inAppWalletMain.GetLinkedAccounts();
210+
// Console.WriteLine($"Old linked accounts: {JsonConvert.SerializeObject(oldLinkedAccounts, Formatting.Indented)}");
211+
212+
// var inAppWalletToLink = await InAppWallet.Create(client: client, authProvider: AuthProvider.Guest);
213+
// _ = await inAppWalletMain.LinkAccount(walletToLink: inAppWalletToLink);
214214

215215
// var linkedAccounts = await inAppWalletMain.GetLinkedAccounts();
216216
// Console.WriteLine($"Linked accounts: {JsonConvert.SerializeObject(linkedAccounts, Formatting.Indented)}");
@@ -302,7 +302,7 @@
302302

303303
#region InAppWallet - OAuth
304304

305-
// var inAppWalletOAuth = await InAppWallet.Create(client: client, authProvider: AuthProvider.Telegram);
305+
// var inAppWalletOAuth = await InAppWallet.Create(client: client, authProvider: AuthProvider.Line);
306306
// if (!await inAppWalletOAuth.IsConnected())
307307
// {
308308
// _ = await inAppWalletOAuth.LoginWithOauth(

Thirdweb/Thirdweb.Wallets/InAppWallet/EcosystemWallet/EcosystemWallet.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public static async Task<EcosystemWallet> Create(
7575
AuthProvider.Farcaster => "Farcaster",
7676
AuthProvider.Telegram => "Telegram",
7777
AuthProvider.Siwe => "Siwe",
78+
AuthProvider.Line => "Line",
7879
AuthProvider.Guest => "Guest",
7980
AuthProvider.Default => string.IsNullOrEmpty(email) ? "Phone" : "Email",
8081
_ => throw new ArgumentException("Invalid AuthProvider"),
@@ -302,6 +303,7 @@ public async Task<List<LinkedAccount>> LinkAccount(
302303
case "Discord":
303304
case "Farcaster":
304305
case "Telegram":
306+
case "Line":
305307
serverRes = await walletToLink.PreAuth_OAuth(isMobile ?? false, browserOpenAction, mobileRedirectScheme, browser).ConfigureAwait(false);
306308
break;
307309
default:

Thirdweb/Thirdweb.Wallets/InAppWallet/InAppWallet.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public enum AuthProvider
2121
Farcaster,
2222
Telegram,
2323
Siwe,
24+
Line,
2425
Guest
2526
}
2627

@@ -100,6 +101,7 @@ public static async Task<InAppWallet> Create(
100101
Thirdweb.AuthProvider.Farcaster => "Farcaster",
101102
Thirdweb.AuthProvider.Telegram => "Telegram",
102103
Thirdweb.AuthProvider.Siwe => "Siwe",
104+
Thirdweb.AuthProvider.Line => "Line",
103105
Thirdweb.AuthProvider.Guest => "Guest",
104106
Thirdweb.AuthProvider.Default => string.IsNullOrEmpty(email) ? "Phone" : "Email",
105107
_ => throw new ArgumentException("Invalid AuthProvider"),
@@ -224,6 +226,7 @@ public async Task<List<LinkedAccount>> LinkAccount(
224226
case "Discord":
225227
case "Farcaster":
226228
case "Telegram":
229+
case "Line":
227230
serverRes = await walletToLink.PreAuth_OAuth(isMobile ?? false, browserOpenAction, mobileRedirectScheme, browser).ConfigureAwait(false);
228231
break;
229232
default:

0 commit comments

Comments
 (0)