Merged PR 683: update sec headers applied
update sec headers applied Related work items: #6937
This commit is contained in:
+2
-2
@@ -60,9 +60,9 @@ I18N_DOMAIN = "cymru.local"
|
||||
GG_PROVIDER_CONFIG_ENDPOINT = "https://api.ete.access.service.gov.uk/.well-known/openid-configuration"
|
||||
GG_CLIENT_ID = 5vTukeSpN7d6uBV7YLb7A5wOctzzkZ
|
||||
GG_CLIENT_SECRET = z1PGLAKPxIhjMBegTdzX22AayIORc1GsCbMQZ6mieBn7zChjzzxup5lkIByEmsYS
|
||||
GG_REDIRECT_URI = "https://dev-planningcasework.service.gov.wales"
|
||||
GG_REDIRECT_URI = "http://localhost:3000"
|
||||
|
||||
NEXT_PUBLIC_GG_CLIENT_ID = 5vTukeSpN7d6uBV7YLb7A5wOctzzkZ
|
||||
NEXT_PUBLIC_GG_REDIRECT_URI = "https://dev-planningcasework.service.gov.wales"
|
||||
NEXT_PUBLIC_GG_REDIRECT_URI = "http://localhost:3000"
|
||||
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ const MyPortal = (props) => {
|
||||
const handleLogout = () => {
|
||||
destroyCookie({}, "pinsUser"),
|
||||
window.localStorage.clear(),
|
||||
router.replace("/");
|
||||
router.replace(props.ggLogout);
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -97,8 +97,7 @@ const MyPortal = (props) => {
|
||||
>
|
||||
<a
|
||||
onClick={() => {
|
||||
destroyCookie({}, "pinsUser"),
|
||||
window.localStorage.clear();
|
||||
handleLogout();
|
||||
}}
|
||||
className="govuk-header__link govuk-!-margin-right-3"
|
||||
>
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ module.exports = {
|
||||
return [
|
||||
{
|
||||
// Apply these headers to all routes in your application.
|
||||
source: "/(.*)",
|
||||
source: "/(.*)?",
|
||||
headers: securityHeaders,
|
||||
},
|
||||
];
|
||||
|
||||
+30
-1
@@ -34,6 +34,8 @@ import {
|
||||
setAwaitingSubmission,
|
||||
setAwaitingSubmissionDetails,
|
||||
} from "../../store/awaitingSubmission/action";
|
||||
import { getGovGatewayConfig } from "../../store/govgateway/action";
|
||||
|
||||
import {
|
||||
getToken,
|
||||
getPersonalAccount,
|
||||
@@ -44,6 +46,13 @@ import {
|
||||
getPortalModuleDetails,
|
||||
} from "../../actions";
|
||||
|
||||
import {
|
||||
getProviderConfig,
|
||||
getGGToken,
|
||||
getUserInfo,
|
||||
getPortalLogin,
|
||||
} from "../../actions/govgateway";
|
||||
|
||||
const Home = (props) => {
|
||||
const {
|
||||
footerLinks,
|
||||
@@ -53,6 +62,7 @@ const Home = (props) => {
|
||||
watchedCases,
|
||||
awaitingSubmission,
|
||||
accountDetails,
|
||||
govGateway,
|
||||
} = props;
|
||||
let { t, lang } = useTranslation();
|
||||
|
||||
@@ -139,6 +149,7 @@ const Home = (props) => {
|
||||
watchedCases={watchedCases}
|
||||
awaitingSubmission={awaitingSubmission}
|
||||
accountDetails={accountDetails}
|
||||
ggLogout={govGateway.config.end_session_endpoint}
|
||||
/>
|
||||
</div>
|
||||
<Footer footerLinks={footerLinks} />
|
||||
@@ -161,6 +172,18 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
|
||||
let loggedInUser = cookies.pinsUser;
|
||||
|
||||
let providerConfig = await getProviderConfig();
|
||||
|
||||
console.log(
|
||||
"logout endpoint: ",
|
||||
providerConfig.end_session_endpoint,
|
||||
"\n",
|
||||
"redirect:",
|
||||
process.env.GG_REDIRECT_URI
|
||||
);
|
||||
|
||||
store.dispatch(getGovGatewayConfig(providerConfig));
|
||||
|
||||
const [
|
||||
accountDetails,
|
||||
myCases,
|
||||
@@ -176,7 +199,12 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
]);
|
||||
|
||||
//const cookiesMaker = nookies.get(ctx)
|
||||
console.log(accountDetails);
|
||||
console.log(
|
||||
"acc details:",
|
||||
accountDetails,
|
||||
_.has(accountDetails, "errorCode") != false
|
||||
);
|
||||
|
||||
const [
|
||||
myCasesDetails,
|
||||
myRepresentationsDetails,
|
||||
@@ -251,6 +279,7 @@ const mapStateToProps = (state) => {
|
||||
watchedCases: state.watchedCases,
|
||||
myRepresentations: state.myRepresentations,
|
||||
awaitingSubmission: state.awaitingSubmission,
|
||||
govGateway: state.govGateway,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user