From 0a2f1720b4580eddc4d523d22948e0ca313ec30f Mon Sep 17 00:00:00 2001 From: John Duprey Date: Sun, 2 Mar 2025 19:32:13 -0500 Subject: [PATCH 1/2] test invalidate auth querykey on redirect --- src/api/ApiCall.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/api/ApiCall.jsx b/src/api/ApiCall.jsx index b8a38648769a..e7feb6f5748f 100644 --- a/src/api/ApiCall.jsx +++ b/src/api/ApiCall.jsx @@ -3,7 +3,6 @@ import axios, { isAxiosError } from "axios"; import { useDispatch } from "react-redux"; import { showToast } from "../store/toasts"; import { getCippError } from "../utils/get-cipp-error"; -import { useRouter } from "next/router"; export function ApiGetCall(props) { const { @@ -29,6 +28,12 @@ export function ApiGetCall(props) { returnRetry = false; } if (isAxiosError(error) && HTTP_STATUS_TO_NOT_RETRY.includes(error.response?.status ?? 0)) { + if ( + error.response?.status === 302 && + error.response?.headers.get("location").includes("/.auth/login/aad") + ) { + queryClient.invalidateQueries({ queryKey: ["authmecipp"] }); + } returnRetry = false; } if (returnRetry === false && toast) { From e6873838fea2e97d1d526f4e979ec8cac3d2f174 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Sun, 2 Mar 2025 21:10:32 -0500 Subject: [PATCH 2/2] fix: addtogroup functionality --- .../CippFormPages/CippAddEditUser.jsx | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/components/CippFormPages/CippAddEditUser.jsx b/src/components/CippFormPages/CippAddEditUser.jsx index f772ae0e8e0e..5aeab622c02c 100644 --- a/src/components/CippFormPages/CippAddEditUser.jsx +++ b/src/components/CippFormPages/CippAddEditUser.jsx @@ -291,7 +291,6 @@ const CippAddEditUser = (props) => { multiple={false} /> - {/* Schedule User Creation */} { multiple={false} /> + {formType === "edit" && ( + + + + )} + {/* Schedule User Creation */} {formType === "add" && (