adding debug code
This commit is contained in:
+4
-4
@@ -58,11 +58,11 @@ I18N_DOMAIN = "cymru.local"
|
|||||||
|
|
||||||
//gov gateway
|
//gov gateway
|
||||||
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 = "http://localhost:3000"
|
GG_REDIRECT_URI = "https://dev-planningcasework.service.gov.wales"
|
||||||
|
|
||||||
NEXT_PUBLIC_GG_ClIENT_ID = 5vTukeSpN7d6uBV7YLb7A5wOctzzkZ
|
NEXT_PUBLIC_GG_CLIENT_ID = 5vTukeSpN7d6uBV7YLb7A5wOctzzkZ
|
||||||
NEXT_PUBLIC_GG_REDIRECT_URI = "http://localhost:3000"
|
NEXT_PUBLIC_GG_REDIRECT_URI = "https://dev-planningcasework.service.gov.wales"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import axios from "axios";
|
|||||||
import { hashAPIPath } from "./";
|
import { hashAPIPath } from "./";
|
||||||
|
|
||||||
const configEndpoint = process.env.GG_PROVIDER_CONFIG_ENDPOINT;
|
const configEndpoint = process.env.GG_PROVIDER_CONFIG_ENDPOINT;
|
||||||
const ggClientID = process.env.GG_ClIENT_ID;
|
const ggClientID = process.env.GG_CLIENT_ID;
|
||||||
const ggClientSecret = process.env.GG_CLIENT_SECRET;
|
const ggClientSecret = process.env.GG_CLIENT_SECRET;
|
||||||
const WEBAPI_URL =
|
const WEBAPI_URL =
|
||||||
process.env.RELAY_ROOT ||
|
process.env.RELAY_ROOT ||
|
||||||
|
|||||||
@@ -117,6 +117,17 @@ let Login = (props) => {
|
|||||||
// const [showSpinnerState, setShowSpinnerState] = useState(false);
|
// const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||||
const [validLoginID, setValidLoginID] = useState(null);
|
const [validLoginID, setValidLoginID] = useState(null);
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
"built login url path:",
|
||||||
|
props.govGateway.config.authorization_endpoint +
|
||||||
|
"?response_type=code&scope=openid&client_id=" +
|
||||||
|
process.env.NEXT_PUBLIC_GG_CLIENT_ID +
|
||||||
|
"&redirect_uri=" +
|
||||||
|
process.env.NEXT_PUBLIC_GG_REDIRECT_URI +
|
||||||
|
"&ui_locales=" +
|
||||||
|
(router.locale == "cy" ? "cy" : "en-GB")
|
||||||
|
);
|
||||||
|
|
||||||
// let spinnerState = () => {
|
// let spinnerState = () => {
|
||||||
// showSpinnerState == true
|
// showSpinnerState == true
|
||||||
// ? setShowSpinnerState(false)
|
// ? setShowSpinnerState(false)
|
||||||
@@ -162,15 +173,18 @@ let Login = (props) => {
|
|||||||
}, [cookies.pinsUser, router]);
|
}, [cookies.pinsUser, router]);
|
||||||
|
|
||||||
const govGatwayLoginRedirect = () => {
|
const govGatwayLoginRedirect = () => {
|
||||||
router.replace(
|
let ggUrl =
|
||||||
props.govGateway.config.authorization_endpoint +
|
props.govGateway.config.authorization_endpoint +
|
||||||
"?response_type=code&scope=openid&client_id=" +
|
"?response_type=code&scope=openid&client_id=" +
|
||||||
process.env.NEXT_PUBLIC_GG_ClIENT_ID +
|
process.env.NEXT_PUBLIC_GG_CLIENT_ID +
|
||||||
"&redirect_uri=" +
|
"&redirect_uri=" +
|
||||||
process.env.NEXT_PUBLIC_GG_REDIRECT_URI +
|
process.env.NEXT_PUBLIC_GG_REDIRECT_URI +
|
||||||
"&ui_locales=" +
|
"&ui_locales=" +
|
||||||
(router.locale == "cy" ? "cy" : "en-GB")
|
(router.locale == "cy" ? "cy" : "en-GB");
|
||||||
);
|
|
||||||
|
console.log("login Url:", ggUrl);
|
||||||
|
|
||||||
|
router.replace(ggUrl);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
+4
-1
@@ -170,7 +170,10 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
providerConfig.token_endpoint,
|
providerConfig.token_endpoint,
|
||||||
"\n",
|
"\n",
|
||||||
"hasloginCode:",
|
"hasloginCode:",
|
||||||
hasLoginCode
|
hasLoginCode,
|
||||||
|
"\n",
|
||||||
|
"redirect:",
|
||||||
|
process.env.GG_REDIRECT_URI
|
||||||
);
|
);
|
||||||
|
|
||||||
store.dispatch(getGovGatewayConfig(providerConfig));
|
store.dispatch(getGovGatewayConfig(providerConfig));
|
||||||
|
|||||||
Reference in New Issue
Block a user