Skip to content

Commit 09aea10

Browse files
committed
Fixed that auto federation can only occur when an email was already in use
1 parent 0a400a7 commit 09aea10

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Packages/Sequence-Unity/Sequence/SequenceSDK/EmbeddedWallet/SequenceLogin.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,19 +459,20 @@ public async Task ConnectToWaaS(IntentDataOpenSession loginIntent, LoginMethod m
459459
}
460460
catch (Exception e)
461461
{
462-
if (e.Message.Contains(EmailInUseError))
462+
var emailInUse = e.Message.Contains(EmailInUseError);
463+
if (emailInUse)
463464
{
464465
List<LoginMethod> associatedLoginMethods = ParseLoginMethods(e.Message);
465466
OnLoginFailed?.Invoke("Error registering session: " + e.Message, method, email, associatedLoginMethods);
467+
_failedLoginIntent = loginIntent;
468+
_failedLoginMethod = method;
469+
_failedLoginEmail = email;
466470
}
467471
else
468472
{
469473
OnLoginFailed?.Invoke("Error registering session: " + e.Message, method, email);
470474
}
471475
_isLoggingIn = false;
472-
_failedLoginIntent = loginIntent;
473-
_failedLoginMethod = method;
474-
_failedLoginEmail = email;
475476
return;
476477
}
477478

@@ -632,6 +633,9 @@ public void ForceCreateAccount()
632633

633634
private async Task ForceCreateWaaSAccount()
634635
{
636+
if (string.IsNullOrEmpty(_failedLoginEmail))
637+
throw new Exception("Failed to force create account.");
638+
635639
_failedLoginIntent.forceCreateAccount = true;
636640

637641
await ConnectToWaaS(_failedLoginIntent, _failedLoginMethod, _failedLoginEmail);

Packages/Sequence-Unity/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "xyz.0xsequence.waas-unity",
3-
"version": "5.0.10",
3+
"version": "5.0.11",
44
"displayName": "Sequence SDK",
55
"description": "A Unity SDK for Sequence APIs",
66
"unity": "2021.3",

0 commit comments

Comments
 (0)