tweak to auth

This commit is contained in:
2023-11-09 12:31:53 +00:00
parent ef1f773022
commit 6a927155bc
4 changed files with 41 additions and 15 deletions
+21
View File
@@ -86,6 +86,27 @@ const SearchResults = (props) => {
const cookies = parseCookies();
const selectWatchedCase = (loggedInUser, incidentID, appealType) => {
let updateBody = {
"pinswg_WatchedCase@odata.bind": "/incidents(" + incidentID + ")",
"pinswg_Contact@odata.bind": "/contacts(" + loggedInUser + ")",
"pinswg_appealcasetype": +appealType,
};
createWatchedCases(updateBody)
.then((data) => data)
.then(() => {
getWatchedCasesProxy(props.accountDetails.loggedinUserId).then(
(data) => {
setWatchedCases(data),
getDetails(data, "myWatchedCases").then((data) => {
setWatchedCasesDetails(data);
});
}
);
});
};
const isWatchedCase = (whichIncident) => {
let isWatched = jsonpath.query(
watchedCases,
+1 -1
View File
@@ -42,7 +42,7 @@
"multiparty": "^4.2.3",
"mysql": "^2.18.1",
"nanoid": "^3.2.0",
"next": "13.4",
"next": "^14.0.1",
"next-auth": "^4.22.1",
"next-connect": "^0.12.2",
"next-redux-wrapper": "^7.0.5",
+18 -14
View File
@@ -64,23 +64,27 @@ class MyDocument extends Document {
)}
{!process.browser && (
<>
<script nonce={generatedNonce}>
window.switchDomain = {process.env.I18N_DOMAIN}
</script>
<script nonce={generatedNonce}>
window.apiRoot = {process.env.API_ROOT}
</script>
<script
nonce={generatedNonce}
dangerouslySetInnerHTML={{
__html:
"window.switchDomain = '" +
process.env.I18N_DOMAIN +
"'",
}}
/>
<script
nonce={generatedNonce}
dangerouslySetInnerHTML={{
__html:
"window.apiRoot = '" +
process.env.API_ROOT +
"'",
}}
/>
</>
)}
{typeof window !== "undefined" && (
<>
<div>hello</div>
<script nonce={generatedNonce}>
{`window.apiRoot = '${process.env.API_ROOT}'`}
</script>
</>
)}
<SkipLink />
<Main />
<NextScript />
+1
View File
@@ -108,6 +108,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
const mapStateToProps = (state) => {
return {
accountDetails: state.accountDetails,
search: state.search,
searchResultsObj: state.searchResultsObj,
formData: state.formData,