diff --git a/packages/common/utils/axiosClient.js b/packages/common/utils/axiosClient.js index d1766460d2..1dcdd55a04 100644 --- a/packages/common/utils/axiosClient.js +++ b/packages/common/utils/axiosClient.js @@ -1,6 +1,6 @@ import axios from "axios"; -import { setCookie } from "./"; +import { setCookie, deleteCookie } from "./"; import combineUrl from "./combineUrl"; import defaultConfig from "PUBLIC_DIR/scripts/config.json"; @@ -130,6 +130,7 @@ class AxiosClient { if (error) throw new Error(error); if (response.headers["x-redirect-uri"] && options.withRedirect) { + deleteCookie("disable_redirect"); return window.location.replace(response.headers["x-redirect-uri"]); } diff --git a/packages/login/src/client/components/sub-components/Consent.tsx b/packages/login/src/client/components/sub-components/Consent.tsx index 3f8ea26b29..39c0d708aa 100644 --- a/packages/login/src/client/components/sub-components/Consent.tsx +++ b/packages/login/src/client/components/sub-components/Consent.tsx @@ -103,10 +103,10 @@ const Consent = ({ clientState = c.replace("client_state=", "").trim(); }); - console.log(clientState); + deleteCookie("client_id"); + deleteCookie("client_state"); - // deleteCookie("client_id"); - // deleteCookie("client_state"); + setCookie("disable_redirect", true); await api.oauth.onOAuthSubmit(clientId, clientState, scope); }; @@ -130,6 +130,8 @@ const Consent = ({ deleteCookie("client_id"); deleteCookie("client_state"); + setCookie("disable_redirect", true); + await api.oauth.onOAuthCancel(clientId, clientState); };