redirect login attempts to status page
This commit is contained in:
+10
-8
@@ -53,7 +53,9 @@ const SignIn = (props) => {
|
|||||||
<div className="govuk-body-m">
|
<div className="govuk-body-m">
|
||||||
<legend className="govuk-fieldset__legend govuk-fieldset__legend--l">
|
<legend className="govuk-fieldset__legend govuk-fieldset__legend--l">
|
||||||
<h1 className="govuk-fieldset__heading govuk-heading-m">
|
<h1 className="govuk-fieldset__heading govuk-heading-m">
|
||||||
{t("auth:auth-page-title")}{" "}
|
{t(
|
||||||
|
"auth:auth-page-title",
|
||||||
|
)}{" "}
|
||||||
</h1>
|
</h1>
|
||||||
</legend>
|
</legend>
|
||||||
|
|
||||||
@@ -91,7 +93,7 @@ const SignIn = (props) => {
|
|||||||
htmlFor="email"
|
htmlFor="email"
|
||||||
>
|
>
|
||||||
{t(
|
{t(
|
||||||
"auth:auth-email-label"
|
"auth:auth-email-label",
|
||||||
)}
|
)}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
@@ -111,7 +113,7 @@ const SignIn = (props) => {
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
{t(
|
{t(
|
||||||
"auth:auth-signin-button-label"
|
"auth:auth-signin-button-label",
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -132,10 +134,10 @@ const SignIn = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export async function getServerSideProps(context) {
|
export async function getServerSideProps(context) {
|
||||||
if (process.env.SHOWLOGIN == false) {
|
if (process.env.SHOWLOGIN === "false" || process.env.SHOWLOGIN === false) {
|
||||||
return {
|
return {
|
||||||
redirect: {
|
redirect: {
|
||||||
destination: "/404",
|
destination: "/status",
|
||||||
permanent: false,
|
permanent: false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -146,7 +148,7 @@ export async function getServerSideProps(context) {
|
|||||||
"\n//////////////////////\n",
|
"\n//////////////////////\n",
|
||||||
"Sign in callbackurl: " + context.query.callbackUrl,
|
"Sign in callbackurl: " + context.query.callbackUrl,
|
||||||
context.locale,
|
context.locale,
|
||||||
"\n//////////////////////\n"
|
"\n//////////////////////\n",
|
||||||
);
|
);
|
||||||
let formURL = context.req.headers.host;
|
let formURL = context.req.headers.host;
|
||||||
//console.log("formUrl:", formURL);
|
//console.log("formUrl:", formURL);
|
||||||
@@ -176,7 +178,7 @@ export async function getServerSideProps(context) {
|
|||||||
|
|
||||||
// Append the query parameters to the new URL
|
// Append the query parameters to the new URL
|
||||||
params.forEach((value, key) =>
|
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
|
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" &&
|
typeof context.query.callbackUrl != "undefined" &&
|
||||||
(formURL = appendParamsAndPathToNewUrl(
|
(formURL = appendParamsAndPathToNewUrl(
|
||||||
context.query.callbackUrl,
|
context.query.callbackUrl,
|
||||||
formURL
|
formURL,
|
||||||
));
|
));
|
||||||
|
|
||||||
//formURL = appendParamsAndPathToNewUrl(context.query.callbackUrl, formURL);
|
//formURL = appendParamsAndPathToNewUrl(context.query.callbackUrl, formURL);
|
||||||
|
|||||||
@@ -236,10 +236,10 @@ export async function getServerSideProps(context) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.env.SHOWLOGIN == false) {
|
if (process.env.SHOWLOGIN === "false" || process.env.SHOWLOGIN === false) {
|
||||||
return {
|
return {
|
||||||
redirect: {
|
redirect: {
|
||||||
destination: "/404",
|
destination: "/status",
|
||||||
permanent: false,
|
permanent: false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -250,7 +250,7 @@ export async function getServerSideProps(context) {
|
|||||||
"\n//////////////////////\n",
|
"\n//////////////////////\n",
|
||||||
"Sign in callbackurl: " + context.req.headers.host,
|
"Sign in callbackurl: " + context.req.headers.host,
|
||||||
context.locale,
|
context.locale,
|
||||||
csrfToken + "\n//////////////////////\n"
|
csrfToken + "\n//////////////////////\n",
|
||||||
);
|
);
|
||||||
let formURL = context.req.headers.host;
|
let formURL = context.req.headers.host;
|
||||||
console.log("formUrl:", formURL);
|
console.log("formUrl:", formURL);
|
||||||
|
|||||||
Reference in New Issue
Block a user