From c6529981899b0e1f52c4bba886f365d41cd74a17 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Tue, 23 Nov 2021 20:20:43 +0000 Subject: [PATCH] removed credential request --- .env.local | 57 ++++++++++++++++++++++++---------------------- actions/index.js | 16 ++++++------- pages/_document.js | 18 +++++++-------- 3 files changed, 47 insertions(+), 44 deletions(-) diff --git a/.env.local b/.env.local index c3a7589c..7395ffd6 100644 --- a/.env.local +++ b/.env.local @@ -1,3 +1,17 @@ + + +ACCESS_TOKEN_ENDPOINT = https://login.microsoftonline.com/ +TENANT = a8d860de-d5e1-45af-8376-d93f02e6b502 +GRANT_TYPE = "client_credentials" + +HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136d84f68818d3a96399467b52143e273d4f3bf4ae190848891535421cd6c +NEXT_PUBLIC_HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136d84f68818d3a96399467b52143e273d4f3bf4ae190848891535421cd6c + + +//Dev oauth +//CLIENT_ID = e082def0-3453-461f-9a5e-f4ab127dc015 +//CLIENT_SECRET = qW.7Q~TSr3sZmLEnJQJPXEdOckb_yo2t1yJmY + // dev //RELAY_ROOT = https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/ //RELAYURI = "dev-pedw-ns.servicebus.windows.net" @@ -6,36 +20,20 @@ //SASKEYNAME = "devpedwnspolicy" - -ACCESS_TOKEN_ENDPOINT = https://login.microsoftonline.com/ -TENANT = a8d860de-d5e1-45af-8376-d93f02e6b502 -GRANT_TYPE = "client_credentials" - -//Dev oauth -CLIENT_ID = e082def0-3453-461f-9a5e-f4ab127dc015 -CLIENT_SECRET = qW.7Q~TSr3sZmLEnJQJPXEdOckb_yo2t1yJmY - - //Test Oauth -//CLIENT_ID = e082def0-3453-461f-9a5e-f4ab127dc015 -//CLIENT_SECRET = qW.7Q~TSr3sZmLEnJQJPXEdOckb_yo2t1yJmY - - -PORT= "3000" -DEFAULT_DOMAIN = "localhost" -I18N_DOMAIN = "cymru.local" -//I18N_DOMAIN ="dev-gwaithcynllunio.gwasanaeth.llyw.cymru" -//I18N_DOMAIN ="stage-gwaithcynllunio.gwasanaeth.llyw.cymru" -//I18N_DOMAIN ="pp-gwaithcynllunio.gwasanaeth.llyw.cymru" -//I18N_DOMAIN ="gwaithcynllunio.gwasanaeth.llyw.cymru" +CLIENT_ID = 6619ad85-c908-490d-811b-de8c93c0f2aa +CLIENT_SECRET = qKo7Q~5QvLEplbwnBbint_I5lXqx_-kDm8Vj- //test -//RELAY_ROOT = https://test-pedw-ns.servicebus.windows.net/test-pedw-hc/ -//RELAYURI = "test-pedw-ns.servicebus.windows.net" -//RELAYPATH = "test-pedw-hc" +RELAY_ROOT = https://test-pedw-ns.servicebus.windows.net/test-pedw-hc/ +RELAYURI = "test-pedw-ns.servicebus.windows.net" +RELAYPATH = "test-pedw-hc" //SASKEY = "kTLrs9UHwuW9Msc9uNfjf+89qLYT6ly80lK0zdTYJW4=" //SASKEYNAME = "testpedwhcpolicy" +//Preprod Oauth +//CLIENT_ID = 6619ad85-c908-490d-811b-de8c93c0f2aa +/CLIENT_SECRET = qKo7Q~5QvLEplbwnBbint_I5lXqx_-kDm8Vj- //preprod //RELAY_ROOT = https://pp-pedw-ns.servicebus.windows.net/pp-pedw-hc/ @@ -48,8 +46,13 @@ I18N_DOMAIN = "cymru.local" GOOGLE_TAG_MANAGER = GTM-T78CBC3 SHOWLOGIN = "true" SHOWREPRESENTATIONS = "false" -BASIC_AUTH_CREDENTIALS,, = pinswg:password|pinswg2:password2 +//BASIC_AUTH_CREDENTIALS = pinswg:password|pinswg2:password2 -HASHKEY = "028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136d84f68818d3a96399467b52143e273d4f3bf4ae190848891535421cd6c" -NEXT_PUBLIC_HASHKEY = "028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136d84f68818d3a96399467b52143e273d4f3bf4ae190848891535421cd6c" +PORT= "3000" +DEFAULT_DOMAIN = "localhost" +I18N_DOMAIN = "cymru.local" +//I18N_DOMAIN ="dev-gwaithcynllunio.gwasanaeth.llyw.cymru" +//I18N_DOMAIN ="stage-gwaithcynllunio.gwasanaeth.llyw.cymru" +//I18N_DOMAIN ="pp-gwaithcynllunio.gwasanaeth.llyw.cymru"s +//I18N_DOMAIN ="gwaithcynllunio.gwasanaeth.llyw.cymru" \ No newline at end of file diff --git a/actions/index.js b/actions/index.js index 04dc85d4..da2a4138 100644 --- a/actions/index.js +++ b/actions/index.js @@ -76,7 +76,7 @@ const azureHeaders = (access_token) => { headers: { "OData-MaxVersion": "4.0", "OData-Version": "4.0", - "Accept": "application/json", + "Accept": "application/json;odata.metadata=none", "Prefer": 'odata.include-annotations="*",return=representation', "Content-Type": "application/json", "Authorization": "Bearer " + access_token, @@ -89,7 +89,7 @@ const azureHeadersPaged = (access_token) => { headers: { "OData-MaxVersion": "4.0", "OData-Version": "4.0", - "Accept": "application/json", + "Accept": "application/json;odata.metadata=none", "Prefer": 'odata.include-annotations="*",return=representation, odata.maxpagesize=10', "Content-Type": "application/json", @@ -669,7 +669,7 @@ export const getLogin = (emailAddress, pwd) => { emailAddress + "' and pinswg_custom_password eq '" + pwd + - "'&$count=true&$select=emailaddress1,%20contactid,pinswg_custom_password, yomifullname, firstname, lastname"; + "'&$count=true&$select=emailaddress1,contactid,pinswg_custom_password,yomifullname,firstname,lastname"; return axios .get(queryUrl + hashAPIPath(queryUrl)) @@ -697,7 +697,7 @@ export const createCase = (token, appealTypeId, lpaID, contactid) => { headers: { "OData-MaxVersion": "4.0", "OData-Version": "4.0", - "Accept": "application/json", + "Accept": "application/json;odata.metadata=none", "Prefer": 'odata.include-annotations="*",return=representation', "Content-Type": "application/json", "ServiceBusAuthorization": token, @@ -740,7 +740,7 @@ export const updateCase = async ( headers: { "OData-MaxVersion": "4.0", "OData-Version": "4.0", - "Accept": "application/json", + "Accept": "application/json;odata.metadata=none", "Prefer": 'odata.include-annotations="*",return=representation', "Content-Type": "application/json", "Authorization": getToken(), @@ -810,7 +810,7 @@ export const deleteMyRepresentations = (myRepresentationsID) => { headers: { "OData-MaxVersion": "4.0", "OData-Version": "4.0", - "Accept": "application/json", + "Accept": "application/json;odata.metadata=none", "Prefer": 'odata.include-annotations="*",return=representation', "Content-Type": "application/json", "Authorization": getToken(), @@ -889,7 +889,7 @@ export const createWatchedCases = (formValues) => { headers: { "OData-MaxVersion": "4.0", "OData-Version": "4.0", - "Accept": "application/json", + "Accept": "application/json;odata.metadata=none", "Prefer": 'odata.include-annotations="*",return=representation', "Content-Type": "application/json", "Authorization": getToken(), @@ -915,7 +915,7 @@ export const deleteWatchedCases = (watchedCaseID) => { headers: { "OData-MaxVersion": "4.0", "OData-Version": "4.0", - "Accept": "application/json", + "Accept": "application/json;odata.metadata=none", "Prefer": 'odata.include-annotations="*",return=representation', "Content-Type": "application/json", "Authorization": getToken(), diff --git a/pages/_document.js b/pages/_document.js index 85f82767..1484617a 100644 --- a/pages/_document.js +++ b/pages/_document.js @@ -10,17 +10,17 @@ class MyDocument extends Document { let useGATracking = false; // remove this block when not need after softlaunch - let hasBasicAuth = - typeof process.env.BASIC_AUTH_CREDENTIALS != "undefined"; + // let hasBasicAuth = + // typeof process.env.BASIC_AUTH_CREDENTIALS != "undefined"; - console.log(hasBasicAuth); + // console.log(hasBasicAuth); - if (ctx.req && ctx.res) { - hasBasicAuth && - (await basicAuthMiddleware(ctx.req, ctx.res, { - users: process.env.BASIC_AUTH_CREDENTIALS, - })); - } + // if (ctx.req && ctx.res) { + // hasBasicAuth && + // (await basicAuthMiddleware(ctx.req, ctx.res, { + // users: process.env.BASIC_AUTH_CREDENTIALS, + // })); + // } if (ctx.req && ctx.req.headers.cookie) { typeof ctx.req.cookies.CookiePolicy != "undefined"