update sec headers applied
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_PROVIDER_CONFIG_ENDPOINT = "https://api.ete.access.service.gov.uk/.well-known/openid-configuration"
|
||||||
GG_CLIENT_ID = 5vTukeSpN7d6uBV7YLb7A5wOctzzkZ
|
GG_CLIENT_ID = 5vTukeSpN7d6uBV7YLb7A5wOctzzkZ
|
||||||
GG_CLIENT_SECRET = z1PGLAKPxIhjMBegTdzX22AayIORc1GsCbMQZ6mieBn7zChjzzxup5lkIByEmsYS
|
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_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 = () => {
|
const handleLogout = () => {
|
||||||
destroyCookie({}, "pinsUser"),
|
destroyCookie({}, "pinsUser"),
|
||||||
window.localStorage.clear(),
|
window.localStorage.clear(),
|
||||||
router.replace("/");
|
router.replace(props.ggLogout);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -97,8 +97,7 @@ const MyPortal = (props) => {
|
|||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
destroyCookie({}, "pinsUser"),
|
handleLogout();
|
||||||
window.localStorage.clear();
|
|
||||||
}}
|
}}
|
||||||
className="govuk-header__link govuk-!-margin-right-3"
|
className="govuk-header__link govuk-!-margin-right-3"
|
||||||
>
|
>
|
||||||
|
|||||||
+1
-1
@@ -42,7 +42,7 @@ module.exports = {
|
|||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
// Apply these headers to all routes in your application.
|
// Apply these headers to all routes in your application.
|
||||||
source: "/(.*)",
|
source: "/(.*)?",
|
||||||
headers: securityHeaders,
|
headers: securityHeaders,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
+30
-1
@@ -34,6 +34,8 @@ import {
|
|||||||
setAwaitingSubmission,
|
setAwaitingSubmission,
|
||||||
setAwaitingSubmissionDetails,
|
setAwaitingSubmissionDetails,
|
||||||
} from "../../store/awaitingSubmission/action";
|
} from "../../store/awaitingSubmission/action";
|
||||||
|
import { getGovGatewayConfig } from "../../store/govgateway/action";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getToken,
|
getToken,
|
||||||
getPersonalAccount,
|
getPersonalAccount,
|
||||||
@@ -44,6 +46,13 @@ import {
|
|||||||
getPortalModuleDetails,
|
getPortalModuleDetails,
|
||||||
} from "../../actions";
|
} from "../../actions";
|
||||||
|
|
||||||
|
import {
|
||||||
|
getProviderConfig,
|
||||||
|
getGGToken,
|
||||||
|
getUserInfo,
|
||||||
|
getPortalLogin,
|
||||||
|
} from "../../actions/govgateway";
|
||||||
|
|
||||||
const Home = (props) => {
|
const Home = (props) => {
|
||||||
const {
|
const {
|
||||||
footerLinks,
|
footerLinks,
|
||||||
@@ -53,6 +62,7 @@ const Home = (props) => {
|
|||||||
watchedCases,
|
watchedCases,
|
||||||
awaitingSubmission,
|
awaitingSubmission,
|
||||||
accountDetails,
|
accountDetails,
|
||||||
|
govGateway,
|
||||||
} = props;
|
} = props;
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
|
|
||||||
@@ -139,6 +149,7 @@ const Home = (props) => {
|
|||||||
watchedCases={watchedCases}
|
watchedCases={watchedCases}
|
||||||
awaitingSubmission={awaitingSubmission}
|
awaitingSubmission={awaitingSubmission}
|
||||||
accountDetails={accountDetails}
|
accountDetails={accountDetails}
|
||||||
|
ggLogout={govGateway.config.end_session_endpoint}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Footer footerLinks={footerLinks} />
|
<Footer footerLinks={footerLinks} />
|
||||||
@@ -161,6 +172,18 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
|
|
||||||
let loggedInUser = cookies.pinsUser;
|
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 [
|
const [
|
||||||
accountDetails,
|
accountDetails,
|
||||||
myCases,
|
myCases,
|
||||||
@@ -176,7 +199,12 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
//const cookiesMaker = nookies.get(ctx)
|
//const cookiesMaker = nookies.get(ctx)
|
||||||
console.log(accountDetails);
|
console.log(
|
||||||
|
"acc details:",
|
||||||
|
accountDetails,
|
||||||
|
_.has(accountDetails, "errorCode") != false
|
||||||
|
);
|
||||||
|
|
||||||
const [
|
const [
|
||||||
myCasesDetails,
|
myCasesDetails,
|
||||||
myRepresentationsDetails,
|
myRepresentationsDetails,
|
||||||
@@ -251,6 +279,7 @@ const mapStateToProps = (state) => {
|
|||||||
watchedCases: state.watchedCases,
|
watchedCases: state.watchedCases,
|
||||||
myRepresentations: state.myRepresentations,
|
myRepresentations: state.myRepresentations,
|
||||||
awaitingSubmission: state.awaitingSubmission,
|
awaitingSubmission: state.awaitingSubmission,
|
||||||
|
govGateway: state.govGateway,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user