Skip to content

Commit

Permalink
modified / route so that it redirects to start page if no default for…
Browse files Browse the repository at this point in the history
…m is present and a service start page is set
  • Loading branch information
ziggy-cyb committed Oct 19, 2023
1 parent d8e1d96 commit bb8e439
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion runner/src/server/plugins/engine/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Boom from "boom";
import { PluginSpecificConfiguration } from "@hapi/hapi";
import { FormPayload } from "./types";
import { shouldLogin } from "server/plugins/auth";
import config from "config";
import config from "../../config";

configure([
// Configure Nunjucks to allow rendering of content that is revealed conditionally.
Expand Down Expand Up @@ -177,6 +177,11 @@ export const plugin = {
if (model) {
return getStartPageRedirect(request, h, id, model);
}

if (config.serviceStartPage) {
return h.redirect(config.serviceStartPage);
}

throw Boom.notFound("No default form found");
},
});
Expand Down

0 comments on commit bb8e439

Please sign in to comment.