-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle user without Dawnshard identity in transition_by_n_account (#1139
) This has been spotted in the logs. Presumably this can happen for a new account that immediately links a Nintendo account without first going to /tool/signup. Plus miscalleneous refactoring to bring more stuff into Features/
- Loading branch information
1 parent
290835c
commit bd774ee
Showing
13 changed files
with
94 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
DragaliaAPI/DragaliaAPI.Integration.Test/Features/Tool/TransitionTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using DragaliaAPI.Infrastructure; | ||
|
||
namespace DragaliaAPI.Integration.Test.Features.Tool; | ||
|
||
public class TransitionTest : TestFixture | ||
{ | ||
public TransitionTest(CustomWebApplicationFactory factory, ITestOutputHelper testOutputHelper) | ||
: base(factory, testOutputHelper) { } | ||
|
||
[Fact] | ||
public async Task Transition_CorrectIdToken_ReturnsOKResponse() | ||
{ | ||
string token = TokenHelper.GetToken( | ||
DeviceAccountId, | ||
DateTime.UtcNow + TimeSpan.FromMinutes(5) | ||
); | ||
this.Client.DefaultRequestHeaders.Add(DragaliaHttpConstants.Headers.IdToken, token); | ||
|
||
TransitionTransitionByNAccountResponse response = ( | ||
await this.Client.PostMsgpack<TransitionTransitionByNAccountResponse>( | ||
"/transition/transition_by_n_account" | ||
) | ||
).Data; | ||
|
||
response.TransitionResultData.LinkedViewerId.Should().Be((ulong)this.ViewerId); | ||
response.TransitionResultData.AbolishedViewerId.Should().Be(0); | ||
} | ||
|
||
[Fact] | ||
public async Task Transition_NewUser_CorrectIdToken_CreatesAccount_ReturnsOKResponse() | ||
{ | ||
string token = TokenHelper.GetToken( | ||
$"new account {Guid.NewGuid()}", | ||
DateTime.UtcNow + TimeSpan.FromMinutes(5) | ||
); | ||
this.Client.DefaultRequestHeaders.Add(DragaliaHttpConstants.Headers.IdToken, token); | ||
|
||
TransitionTransitionByNAccountResponse response = ( | ||
await this.Client.PostMsgpack<TransitionTransitionByNAccountResponse>( | ||
"/transition/transition_by_n_account" | ||
) | ||
).Data; | ||
|
||
response.TransitionResultData.LinkedViewerId.Should().Be((ulong)this.ViewerId + 1); | ||
response.TransitionResultData.AbolishedViewerId.Should().Be(0); | ||
} | ||
} |
3 changes: 2 additions & 1 deletion
3
...iaAPI.Test/Services/SessionServiceTest.cs → ....Test/Features/Tool/SessionServiceTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
DragaliaAPI/DragaliaAPI/Features/GraphQL/ImpersionationMutations.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
DragaliaAPI/DragaliaAPI/Infrastructure/Authentication/SessionAuthenticationHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters