refactor phase 3a pages-auth targeted actions imports
This commit is contained in:
+11
-11
@@ -7,7 +7,7 @@ import CookieBanner from "../../components/cookieBanner";
|
|||||||
import Footer from "../../components/footer";
|
import Footer from "../../components/footer";
|
||||||
import Header from "../../components/header";
|
import Header from "../../components/header";
|
||||||
import ServiceBanner from "../../components/servicebanner";
|
import ServiceBanner from "../../components/servicebanner";
|
||||||
import { getPreferredLanguage } from "../../actions";
|
import { getPreferredLanguage } from "../../actions/services/accountService";
|
||||||
import { setCookie } from "nookies";
|
import { setCookie } from "nookies";
|
||||||
|
|
||||||
const SignIn = (props) => {
|
const SignIn = (props) => {
|
||||||
@@ -47,7 +47,7 @@ const SignIn = (props) => {
|
|||||||
|
|
||||||
setCookie(null, "pedw_locale", userLang, {
|
setCookie(null, "pedw_locale", userLang, {
|
||||||
path: "/",
|
path: "/",
|
||||||
maxAge: 60 * 60 * 24 * 365,
|
maxAge: 60 * 60 * 24 * 365
|
||||||
});
|
});
|
||||||
|
|
||||||
event.target.callbackUrl.value = url.toString();
|
event.target.callbackUrl.value = url.toString();
|
||||||
@@ -85,7 +85,7 @@ const SignIn = (props) => {
|
|||||||
<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(
|
{t(
|
||||||
"auth:auth-page-title",
|
"auth:auth-page-title"
|
||||||
)}{" "}
|
)}{" "}
|
||||||
</h1>
|
</h1>
|
||||||
</legend>
|
</legend>
|
||||||
@@ -124,7 +124,7 @@ const SignIn = (props) => {
|
|||||||
htmlFor="email"
|
htmlFor="email"
|
||||||
>
|
>
|
||||||
{t(
|
{t(
|
||||||
"auth:auth-email-label",
|
"auth:auth-email-label"
|
||||||
)}
|
)}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ const SignIn = (props) => {
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
{t(
|
{t(
|
||||||
"auth:auth-signin-button-label",
|
"auth:auth-signin-button-label"
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -169,8 +169,8 @@ export async function getServerSideProps(context) {
|
|||||||
return {
|
return {
|
||||||
redirect: {
|
redirect: {
|
||||||
destination: "/status",
|
destination: "/status",
|
||||||
permanent: false,
|
permanent: false
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,7 +179,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);
|
||||||
@@ -209,7 +209,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
|
||||||
@@ -218,7 +218,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);
|
||||||
@@ -233,7 +233,7 @@ export async function getServerSideProps(context) {
|
|||||||
console.log("========== callback: ", url.toString());
|
console.log("========== callback: ", url.toString());
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: { csrfToken: csrfToken, callbackUrl: url.toString() },
|
props: { csrfToken: csrfToken, callbackUrl: url.toString() }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user