diff --git a/Pages/Components/ParticipantSignInPlaceComponent.razor b/Pages/Components/ParticipantSignInPlaceComponent.razor
index 4be86f2..925f9f6 100644
--- a/Pages/Components/ParticipantSignInPlaceComponent.razor
+++ b/Pages/Components/ParticipantSignInPlaceComponent.razor
@@ -9,7 +9,7 @@
@if (SignInPlace.Participant != null)
{
@SignInPlace.Participant.User.Firstname @SignInPlace.Participant.User.Surname
@@ -32,6 +32,7 @@
{
}
@@ -51,7 +52,6 @@
-
diff --git a/Program.cs b/Program.cs
index dd3c861..580d815 100644
--- a/Program.cs
+++ b/Program.cs
@@ -27,7 +27,7 @@
builder.Services.AddHttpClient(nameof(EventulaApiService), client =>
{
- client.BaseAddress = new System.Uri("https://lan2play.de");
+ client.BaseAddress = new System.Uri(builder.Configuration.GetValue("EventulaApiBaseAddress"));
}).ConfigurePrimaryHttpMessageHandler(sp =>
{
var cookieContainer = sp.GetRequiredService();
diff --git a/Services/EventulaApiService.cs b/Services/EventulaApiService.cs
index 2c5cc6b..f341ee8 100644
--- a/Services/EventulaApiService.cs
+++ b/Services/EventulaApiService.cs
@@ -1,12 +1,7 @@
using EventulaEntranceClient.Models;
-using Microsoft.Extensions.Logging;
-using System;
-using System.Linq;
using System.Net;
-using System.Net.Http;
using System.Net.Http.Headers;
using System.Text.Json;
-using System.Threading.Tasks;
namespace EventulaEntranceClient.Services
{
@@ -42,7 +37,9 @@ public async Task RequestTicket(string qrCode)
SetDefaultHeaders(httpClient, await _EventulaTokenService.RetrieveTokenAsync());
var getResult = await httpClient.GetAsync(string.Format(_UserApiParticipantUrl, qrCode.Split('/').Last()));
-
+
+ getResult.EnsureSuccessStatusCode();
+
var content = await getResult.Content.ReadAsStringAsync();
var ticketRequest = JsonSerializer.Deserialize(content, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
@@ -59,6 +56,9 @@ public async Task SignInParticipant(Participant participant)
SetDefaultHeaders(httpClient, await _EventulaTokenService.RetrieveTokenAsync());
var getResult = await httpClient.GetAsync(string.Format(_UserApiParticipantSignInUrl, participant.Id));
+
+ getResult.EnsureSuccessStatusCode();
+
var content = await getResult.Content.ReadAsStringAsync();
var ticketRequest = JsonSerializer.Deserialize(content, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
diff --git a/appsettings.json b/appsettings.json
index 9717ad1..ea69982 100644
--- a/appsettings.json
+++ b/appsettings.json
@@ -6,5 +6,6 @@
}
},
"AllowedHosts": "*",
- "PinSha256": "c50281c3dd92d836d2ba7702fad19f778404cddd49059afc7b2e6e537f436ea7"
+ "PinSha256": "c50281c3dd92d836d2ba7702fad19f778404cddd49059afc7b2e6e537f436ea7",
+ "EventulaApiBaseAddress": "https://lan2play.de"
}