Phase 1 reliability/stabilisation: auth logging, logout client, loader+xml hardening
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user