Phase 1 reliability/stabilisation: auth logging, logout client, loader+xml hardening

This commit is contained in:
2026-05-13 10:05:49 +01:00
parent d36a56c4c9
commit 8fe06c09c4
9 changed files with 125 additions and 49 deletions
+17 -2
View File
@@ -7,7 +7,7 @@ import {
} from "../../actions/services/referenceDataService";
import { getProgressFromBlob } from "../../actions/services/documentService";
import { getPersonalAccount } from "../../actions/services/accountService";
import { getIP } from "../../actions/core/logger";
import { getIP, logInfo, consoleLogger } from "../../actions/core/logger";
import { readFormXml } from "../forms/readFormXml";
import { requireQueryParams } from "../routing/requireQueryParams";
@@ -29,6 +29,10 @@ export async function loadNewAppealPage(ctx) {
const session = await getSession(ctx);
if (!session) {
logInfo("auth.guard.redirect", {
route: "/newappeal/[appealtypes]",
reason: "missing_session"
});
return {
redirect: {
destination: "/auth/signin",
@@ -52,7 +56,18 @@ export async function loadNewAppealPage(ctx) {
const blobProgress = await getProgressFromBlob(loggedInUserIdent, query.id);
const accountDetails = await getPersonalAccount(loggedInUser);
const { xmlStr } = readFormXml(query.appealtypes);
let xmlStr = "";
try {
({ xmlStr } = readFormXml(query.appealtypes));
} catch (error) {
consoleLogger(error);
return {
redirect: {
destination: "/error?reason=formxml",
permanent: false
}
};
}
return {
session,