Skip to content
This repository was archived by the owner on Aug 1, 2021. It is now read-only.

Commit 2eac1f7

Browse files
committed
bug fix
1 parent 73cda35 commit 2eac1f7

File tree

5 files changed

+6
-8
lines changed

5 files changed

+6
-8
lines changed

src/Backend/Jp.Domain/CommandHandlers/ClientCommandHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public async Task<bool> Handle(UpdateClientCommand request, CancellationToken ca
7878
return false;
7979
}
8080

81-
var savedClient = await _clientRepository.GetClient(request.Client.ClientId);
81+
var savedClient = await _clientRepository.GetClient(request.OldClientId);
8282
if (savedClient == null)
8383
{
8484
await Bus.RaiseEvent(new DomainNotification("1", "Client not found"));

src/Frontend/Jp.UI.SSO/Configuration/SecurityHeadersConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static void UseSecurityHeaders(this IApplicationBuilder app, IHostingEnvi
3535
});
3636
options.FontSources(configuration => configuration.Self().CustomSources("https://fonts.googleapis.com/", "https://fonts.gstatic.com/"));
3737
options.ConnectSources(s => s.CustomSources("https://dc.services.visualstudio.com"));
38-
options.ScriptSources(s => s.Self().CustomSources("https://az416426.vo.msecnd.net", @"sha256-ZT3q7lL9GXNGhPTB1Vvrvds2xw/kOV0zoeok2tiV23I="));
38+
options.ScriptSources(s => s.UnsafeInline().CustomSources("https://az416426.vo.msecnd.net", @"sha256-ZT3q7lL9GXNGhPTB1Vvrvds2xw/kOV0zoeok2tiV23I="));
3939

4040
});
4141
}

src/Frontend/Jp.UI.SSO/Controllers/Home/HomeController.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public IActionResult LoginError(string error)
4747

4848
if (error != null)
4949
{
50-
vm.Error = new ErrorMessage(){ErrorDescription = error, Error = "1000"};
50+
vm.Error = new ErrorMessage() { ErrorDescription = error, Error = "1000" };
5151
}
5252

5353
return View("Error", vm);
@@ -63,10 +63,8 @@ public IActionResult SetLanguage(string culture, string returnUrl = "")
6363
new CookieOptions { Expires = System.DateTimeOffset.UtcNow.AddYears(1) }
6464
);
6565

66-
if (string.IsNullOrEmpty(returnUrl))
67-
return RedirectToAction("Index");
66+
return RedirectToAction("Index");
6867

69-
return LocalRedirect(Request.Headers["Referer"].ToString());
7068
}
7169
}
7270
}

src/Frontend/Jp.UI.SSO/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
8686
app.UseHttpsRedirection();
8787
}
8888

89-
app.UseSecurityHeaders(env);
89+
//app.UseSecurityHeaders(env);
9090
app.UseStaticFiles();
9191
app.UseIdentityServer();
9292
app.UseLocalization();

tests/JpProject.Domain.Tests/ClientTests/ClientCommandHandlerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public async Task ShouldUpdateClient()
177177
{
178178
var command = ClientCommandFaker.GenerateUpdateClientCommand().Generate();
179179
_clientRepository.Setup(s => s.UpdateWithChildrens(It.Is<Client>(a => a.ClientId == command.Client.ClientId))).Returns(Task.CompletedTask);
180-
_clientRepository.Setup(s => s.GetClient(It.Is<string>(a => a == command.Client.ClientId))).ReturnsAsync(EntityClientFaker.GenerateClient().Generate());
180+
_clientRepository.Setup(s => s.GetClient(It.Is<string>(a => a == command.OldClientId))).ReturnsAsync(EntityClientFaker.GenerateClient().Generate());
181181
_uow.Setup(s => s.Commit()).Returns(true);
182182

183183
var result = await _commandHandler.Handle(command, _tokenSource.Token);

0 commit comments

Comments
 (0)