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 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) => { const isWatchedCase = (whichIncident) => {
let isWatched = jsonpath.query( let isWatched = jsonpath.query(
watchedCases, watchedCases,
+1 -1
View File
@@ -42,7 +42,7 @@
"multiparty": "^4.2.3", "multiparty": "^4.2.3",
"mysql": "^2.18.1", "mysql": "^2.18.1",
"nanoid": "^3.2.0", "nanoid": "^3.2.0",
"next": "13.4", "next": "^14.0.1",
"next-auth": "^4.22.1", "next-auth": "^4.22.1",
"next-connect": "^0.12.2", "next-connect": "^0.12.2",
"next-redux-wrapper": "^7.0.5", "next-redux-wrapper": "^7.0.5",
+18 -14
View File
@@ -64,23 +64,27 @@ class MyDocument extends Document {
)} )}
{!process.browser && ( {!process.browser && (
<> <>
<script nonce={generatedNonce}> <script
window.switchDomain = {process.env.I18N_DOMAIN} nonce={generatedNonce}
</script> dangerouslySetInnerHTML={{
<script nonce={generatedNonce}> __html:
window.apiRoot = {process.env.API_ROOT} "window.switchDomain = '" +
</script> 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 /> <SkipLink />
<Main /> <Main />
<NextScript /> <NextScript />
+1
View File
@@ -108,6 +108,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
return { return {
accountDetails: state.accountDetails,
search: state.search, search: state.search,
searchResultsObj: state.searchResultsObj, searchResultsObj: state.searchResultsObj,
formData: state.formData, formData: state.formData,