fix(sdk): improve SNS login binding and account handling
- 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 <noreply@anthropic.com>
This commit is contained in:
@@ -221,8 +221,7 @@ namespace tysdk
|
||||
|
||||
public async Task<LoginInfo> LoginBySns()
|
||||
{
|
||||
var accountInfo = AccountInfo.GetSavedAccoutInfo();
|
||||
if (accountInfo == null) return new LoginInfo();
|
||||
Debug.Log("[TYSdkFacade] LoginBySns");
|
||||
|
||||
var task = TYSDKCallbackManager.Instance.RegisterCallback<LoginInfo>(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)
|
||||
|
||||
Reference in New Issue
Block a user