diff options
| author | Leitwolf | 2026-10-16 07:15:42 +0300 |
|---|---|---|
| committer | GitHub | 2026-10-16 07:15:42 +0300 |
| commit | e140d6587a1a74efc205b29582dfbe9942e0f3dc (patch) | |
| tree | 2cc8867a56273c910d00855ac1eeac22fdee1bd6 /apps/api-tests | |
| parent | 3877e3318e875cdebc3d7b9bc970b4496e5183a9 (diff) | |
| parent | bc653270652c1ab44d2144ddd17ae49b404e7cd2 (diff) | |
| download | progmaweb-e140d6587a1a74efc205b29582dfbe9942e0f3dc.tar.gz | |
Merge pull request #38 from Progmasoft/fix/stale-statements
Return a failed Google callback to sign-in and correct stale statements
Diffstat (limited to 'apps/api-tests')
| -rw-r--r-- | apps/api-tests/AccountEndpointTests.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/api-tests/AccountEndpointTests.cs b/apps/api-tests/AccountEndpointTests.cs index 9459081..c5c305e 100644 --- a/apps/api-tests/AccountEndpointTests.cs +++ b/apps/api-tests/AccountEndpointTests.cs @@ -33,6 +33,21 @@ public sealed class AccountEndpointTests Assert.Contains("state=", location.Query, StringComparison.Ordinal); } + [Theory] + [InlineData("/api/v1/accounts/oauth/google/callback")] + [InlineData("/api/v1/accounts/oauth/google/callback?error=access_denied&state=declined")] + [InlineData("/api/v1/accounts/oauth/google/callback?code=forged&state=forged")] + public async Task GoogleCallbackThatCannotFinishReturnsToTheSignInPage(string callback) + { + await using AccountApiFactory factory = new(); + using HttpClient client = factory.CreateAccountClient(handleCookies: false); + + HttpResponseMessage response = await client.GetAsync(callback, TestContext.Current.CancellationToken); + + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Equal("/login?google=failed", response.Headers.Location?.OriginalString); + } + [Fact] public async Task GoogleStartRejectsInvalidAccountNameBeforeLeavingTheSite() { |