Skip to content

Commit

Permalink
Fix the id
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfowl committed Nov 25, 2024
1 parent ffc871e commit cce0802
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Todo.Api.Tests/UserApiTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Text.Json.Serialization;
using Microsoft.AspNetCore.DataProtection;

namespace TodoApi.Tests;

Expand Down Expand Up @@ -116,7 +117,12 @@ public async Task CanGetATokenForExternalUser()
await using var db = application.CreateTodoDbContext();

var client = application.CreateClient();
var response = await client.PostAsJsonAsync("/users/token/Google", new ExternalUserInfo { Username = "todouser", ProviderKey = "1003" });

var encryptedId = application.Services.GetRequiredService<IDataProtectionProvider>()
.CreateProtector("Google")
.Protect("1003");

var response = await client.PostAsJsonAsync("/users/token/Google", new ExternalUserInfo { Username = "todouser", ProviderKey = encryptedId });

Assert.True(response.IsSuccessStatusCode);

Expand Down

0 comments on commit cce0802

Please sign in to comment.