quick fix and refactor

This commit is contained in:
Sebastian 2026-02-20 00:29:26 +01:00
parent 7f603324f8
commit bc7452cd7f
4 changed files with 6 additions and 8 deletions

View file

@ -3,9 +3,9 @@ namespace Registration.API.Configuration;
public class VbytesRelayOptions
{
public string BaseUrl { get; set; } = string.Empty;
public string ParticipantRegisterPath { get; set; } = string.Empty;
public string ParticipantRegisterPath { get; set; } = "/api/participant";
public string ApiKeyHeaderName { get; set; } = "X-Api-Key";
public string ApiKey { get; set; } = string.Empty;
public string ClientCertificatePfxPath { get; set; } = string.Empty;
public string VolunteerRegisterPath { get; set; } = "/api/volunteer/register";
public string VolunteerRegisterPath { get; set; } = "/api/volunteer";
}

View file

@ -14,7 +14,7 @@
"VbytesRelay": {
"BaseUrl": "https://api.lan.vbytes.se",
"ParticipantRegisterPath": "/api/participant",
"VolunteerRegisterPath": "/api/volunteer/register",
"VolunteerRegisterPath": "/api/volunteer",
"ApiKeyHeaderName": "X-Api-Key",
"ApiKey": "",
"ClientCertificatePfxPath": ""

View file

@ -11,7 +11,7 @@
"VbytesRelay": {
"BaseUrl": "https://api.lan.vbytes.se",
"ParticipantRegisterPath": "/api/participant",
"VolunteerRegisterPath": "/api/volunteer/register",
"VolunteerRegisterPath": "/api/volunteer",
"ApiKeyHeaderName": "X-Api-Key",
"ApiKey": "__SET_IN_USER_SECRETS__",
"ClientCertificatePfxPath": "__SET_IN_USER_SECRETS__"

View file

@ -3,7 +3,6 @@
import { useEffect, useState } from "react";
import Link from "next/link";
import { useRouter } from "next/navigation";
interface EventContent {
registrationEnabled: boolean;
@ -12,7 +11,6 @@ interface EventContent {
}
export default function RegisterPage() {
const router = useRouter();
const [content, setContent] = useState<EventContent | null>(null);
const [formData, setFormData] = useState({
firstName: "",
@ -107,7 +105,7 @@ export default function RegisterPage() {
});
if (response.ok) {
setMessage({ type: "success", text: "Registration complete! You are now registered for the LAN." });
setMessage({ type: "success", text: "Registrering slutförd!" });
await fetch(`/api/Registration/register/${formData.ssn}`, {
method: "POST",
@ -129,7 +127,7 @@ export default function RegisterPage() {
<div className="max-w-2xl mx-auto bg-white p-8 rounded-xl shadow-md">
<div className="mb-6">
<Link href="/" className="text-blue-600 hover:text-blue-800 flex items-center gap-1 text-sm font-medium">
Back to Information
Tillbaka till startsidan
</Link>
</div>
<div className="text-center mb-10">