redirect login attempts to status page

This commit is contained in:
2026-01-28 13:30:27 +00:00
parent c8f43710d3
commit b790facf56
2 changed files with 13 additions and 11 deletions
+10 -8
View File
@@ -53,7 +53,9 @@ const SignIn = (props) => {
<div className="govuk-body-m">
<legend className="govuk-fieldset__legend govuk-fieldset__legend--l">
<h1 className="govuk-fieldset__heading govuk-heading-m">
{t("auth:auth-page-title")}{" "}
{t(
"auth:auth-page-title",
)}{" "}
</h1>
</legend>
@@ -91,7 +93,7 @@ const SignIn = (props) => {
htmlFor="email"
>
{t(
"auth:auth-email-label"
"auth:auth-email-label",
)}
</label>
@@ -111,7 +113,7 @@ const SignIn = (props) => {
}
>
{t(
"auth:auth-signin-button-label"
"auth:auth-signin-button-label",
)}
</button>
</div>
@@ -132,10 +134,10 @@ const SignIn = (props) => {
};
export async function getServerSideProps(context) {
if (process.env.SHOWLOGIN == false) {
if (process.env.SHOWLOGIN === "false" || process.env.SHOWLOGIN === false) {
return {
redirect: {
destination: "/404",
destination: "/status",
permanent: false,
},
};
@@ -146,7 +148,7 @@ export async function getServerSideProps(context) {
"\n//////////////////////\n",
"Sign in callbackurl: " + context.query.callbackUrl,
context.locale,
"\n//////////////////////\n"
"\n//////////////////////\n",
);
let formURL = context.req.headers.host;
//console.log("formUrl:", formURL);
@@ -176,7 +178,7 @@ export async function getServerSideProps(context) {
// Append the query parameters to the new URL
params.forEach((value, key) =>
toUrlObj.searchParams.append(key, value)
toUrlObj.searchParams.append(key, value),
);
return toUrlObj.toString(); // Return the full new URL as a string
@@ -185,7 +187,7 @@ export async function getServerSideProps(context) {
typeof context.query.callbackUrl != "undefined" &&
(formURL = appendParamsAndPathToNewUrl(
context.query.callbackUrl,
formURL
formURL,
));
//formURL = appendParamsAndPathToNewUrl(context.query.callbackUrl, formURL);
+3 -3
View File
@@ -236,10 +236,10 @@ export async function getServerSideProps(context) {
};
}
if (process.env.SHOWLOGIN == false) {
if (process.env.SHOWLOGIN === "false" || process.env.SHOWLOGIN === false) {
return {
redirect: {
destination: "/404",
destination: "/status",
permanent: false,
},
};
@@ -250,7 +250,7 @@ export async function getServerSideProps(context) {
"\n//////////////////////\n",
"Sign in callbackurl: " + context.req.headers.host,
context.locale,
csrfToken + "\n//////////////////////\n"
csrfToken + "\n//////////////////////\n",
);
let formURL = context.req.headers.host;
console.log("formUrl:", formURL);