From cb2ff22a898a913056ae02209a49838ebfb04a5d Mon Sep 17 00:00:00 2001 From: tech Date: Tue, 6 Jan 2026 11:25:05 +0800 Subject: [PATCH] fix(sdk): improve SNS login binding and account handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove premature null check in LoginBySns to allow login flow - Add debug logging for SNS login failures - Handle code==-1 case when binding accounts with same userId 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .../Packages/tysdk/Runtime/TYSdkFacade.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sdk-intergration/Packages/tysdk/Runtime/TYSdkFacade.cs b/sdk-intergration/Packages/tysdk/Runtime/TYSdkFacade.cs index 1b1991f..b304e49 100644 --- a/sdk-intergration/Packages/tysdk/Runtime/TYSdkFacade.cs +++ b/sdk-intergration/Packages/tysdk/Runtime/TYSdkFacade.cs @@ -221,8 +221,7 @@ namespace tysdk public async Task LoginBySns() { - var accountInfo = AccountInfo.GetSavedAccoutInfo(); - if (accountInfo == null) return new LoginInfo(); + Debug.Log("[TYSdkFacade] LoginBySns"); var task = TYSDKCallbackManager.Instance.RegisterCallback(TimeSpan.FromSeconds(30)); @@ -240,6 +239,10 @@ namespace tysdk _accountInfo.AddLinkedAccount(accountType); _accountInfo.Save(); } + else + { + Debug.Log($"[TYSdkFacade] LoginBySns failed snsType: {snsType}"); + } return loginInfo; } catch (Exception e) @@ -331,6 +334,12 @@ namespace tysdk _accountInfo.Save(); } } + else if (result.code == -1 && _accountInfo.userId == result.userId) + { + _accountInfo.channel = accoutType; + _accountInfo.AddLinkedAccount(accoutType); + _accountInfo.Save(); + } return result; } catch (Exception e)